Quantcast

(MSITE-640) Maven searches only central repository for imported dependencies

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

(MSITE-640) Maven searches only central repository for imported dependencies

JIRA jira@codehaus.org
Markus Tippmann created MSITE-640:
-------------------------------------

             Summary: Maven searches only central repository for imported dependencies
                 Key: MSITE-640
                 URL: https://jira.codehaus.org/browse/MSITE-640
             Project: Maven 2.x and 3.x Site Plugin
          Issue Type: Bug
          Components: Maven 3
    Affects Versions: 3.0
         Environment: Windows 7
            Reporter: Markus Tippmann
         Attachments: stacktrace.txt

We are using dependencyManagement with "import" scope like described here:
http://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html#Importing_Dependencies

Problem occurs only at site generation, not at build time, where it works perfectly.

The site plugin tries to find the imported artifacts, but searches only the central repository and ignores the repositories in settings.xml configuration. Mirror settings work, if "central" is mirrored, but dependencies need to be resolved from two repositories, so one mirror does not help here.

I try to attach the relevant parts of the stacktrace.



--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://jira.codehaus.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

       
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

(MSITE-640) Maven searches only central repository for imported dependencies

JIRA jira@codehaus.org

    [ https://jira.codehaus.org/browse/MSITE-640?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=297125#comment-297125 ]

Richard Eggert commented on MSITE-640:
--------------------------------------

This problem also manifests itself for parent poms that don't exist in the build tree (i.e., not accessible via the relativePath) or in central (deployed to a repository other than central), as well as for build extensions that do not reside in central.  It seems as if the maven-site-plugin ignores all repositories except central when resolving these.
               

> Maven searches only central repository for imported dependencies
> ----------------------------------------------------------------
>
>                 Key: MSITE-640
>                 URL: https://jira.codehaus.org/browse/MSITE-640
>             Project: Maven 2.x and 3.x Site Plugin
>          Issue Type: Bug
>          Components: Maven 3
>    Affects Versions: 3.0
>         Environment: Windows 7
>            Reporter: Markus Tippmann
>         Attachments: stacktrace.txt
>
>
> We are using dependencyManagement with "import" scope like described here:
> http://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html#Importing_Dependencies
> Problem occurs only at site generation, not at build time, where it works perfectly.
> The site plugin tries to find the imported artifacts, but searches only the central repository and ignores the repositories in settings.xml configuration. Mirror settings work, if "central" is mirrored, but dependencies need to be resolved from two repositories, so one mirror does not help here.
> I try to attach the relevant parts of the stacktrace.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://jira.codehaus.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

       
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

(MSITE-640) Maven searches only central repository for imported dependencies

JIRA jira@codehaus.org
In reply to this post by JIRA jira@codehaus.org

    [ https://jira.codehaus.org/browse/MSITE-640?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=297128#comment-297128 ]

Richard Eggert commented on MSITE-640:
--------------------------------------

I'll try to put together an example that I can attach here when I find some time, but here's how to reproduce the problem for the parent POM use case:

In your active profile in settings.xml, configure a remote repository that points to a location in your local file system.  Make sure that the central repository is independently reachable (either directly or via a configured mirror).

Create a new Maven project with packaging type "pom".  Configure the distributionManagement section such that "mvn deploy" will target the "remote" repository on your file system that you configured in settings.xml.  Run "mvn deploy" on this project, then delete your local repository (but not the "remote" one that you deployed to).

Create a second Maven project with packaging type "pom".  Use the first project configured above as the "parent" POM, but set the relativePath element to be empty (forcing it to be resolved via repository).  In the "modules" section of the POM, specify a sub-module.

Within the second Maven project, create the sub-module project that you specified in the POM, using the containing project's POM as the parent (set relativePath to "..").

From within the second Maven project (the container of the sub-module), run "mvn package".  This should work perfectly.  Then run "mvn site".  This will fail, being unable to resolve the dependency to the parent POM (the first project that you deployed) against the central repository (apparently ignoring the "remote" repository on the local filesystem, as well as the fact that the parent POM was already downloaded into the local repository during "mvn package").

Something similar will happen if you specify a build extension in the sub-module POM.
               

> Maven searches only central repository for imported dependencies
> ----------------------------------------------------------------
>
>                 Key: MSITE-640
>                 URL: https://jira.codehaus.org/browse/MSITE-640
>             Project: Maven 2.x and 3.x Site Plugin
>          Issue Type: Bug
>          Components: Maven 3
>    Affects Versions: 3.0
>         Environment: Windows 7
>            Reporter: Markus Tippmann
>         Attachments: stacktrace.txt
>
>
> We are using dependencyManagement with "import" scope like described here:
> http://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html#Importing_Dependencies
> Problem occurs only at site generation, not at build time, where it works perfectly.
> The site plugin tries to find the imported artifacts, but searches only the central repository and ignores the repositories in settings.xml configuration. Mirror settings work, if "central" is mirrored, but dependencies need to be resolved from two repositories, so one mirror does not help here.
> I try to attach the relevant parts of the stacktrace.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://jira.codehaus.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

       
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

(MSITE-640) Maven searches only central repository for imported dependencies

JIRA jira@codehaus.org
In reply to this post by JIRA jira@codehaus.org

    [ https://jira.codehaus.org/browse/MSITE-640?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=297616#comment-297616 ]

Edward Winston commented on MSITE-640:
--------------------------------------

We recently ran into this problem as well.  It was confusing because it was working on my local machine and not on the server.  As a work around, it appears that if the parent pom in question is installed in your local repository instead of retrieved from a remote repository things will work.  This means that in you ${HOME}/.m2/repository directory find the artifact in question.  Then change the file _maven.repositories to not have the location from where the pom was downloaded.  In our case the file went from this :

bq. parent-pom-1.pom>central=

to this :

bq. parent-pom-1.pom>=

After this change it all worked.
               

> Maven searches only central repository for imported dependencies
> ----------------------------------------------------------------
>
>                 Key: MSITE-640
>                 URL: https://jira.codehaus.org/browse/MSITE-640
>             Project: Maven 2.x and 3.x Site Plugin
>          Issue Type: Bug
>          Components: Maven 3
>    Affects Versions: 3.0
>         Environment: Windows 7
>            Reporter: Markus Tippmann
>         Attachments: stacktrace.txt
>
>
> We are using dependencyManagement with "import" scope like described here:
> http://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html#Importing_Dependencies
> Problem occurs only at site generation, not at build time, where it works perfectly.
> The site plugin tries to find the imported artifacts, but searches only the central repository and ignores the repositories in settings.xml configuration. Mirror settings work, if "central" is mirrored, but dependencies need to be resolved from two repositories, so one mirror does not help here.
> I try to attach the relevant parts of the stacktrace.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://jira.codehaus.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

       
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

(MSITE-640) Maven searches only central repository for imported dependencies

JIRA jira@codehaus.org
In reply to this post by JIRA jira@codehaus.org

    [ https://jira.codehaus.org/browse/MSITE-640?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=316974#comment-316974 ]

Shawn Brown commented on MSITE-640:
-----------------------------------

It sounds like the following issue is related: http://jira.codehaus.org/browse/MSITE-663

I spent some time stepping through the site plugin code while troubleshooting that issue, and the root cause seemed to be that the site plugin wasn't giving Maven the full list of repositories to search.
               

> Maven searches only central repository for imported dependencies
> ----------------------------------------------------------------
>
>                 Key: MSITE-640
>                 URL: https://jira.codehaus.org/browse/MSITE-640
>             Project: Maven 2.x and 3.x Site Plugin
>          Issue Type: Bug
>          Components: Maven 3
>    Affects Versions: 3.0
>         Environment: Windows 7
>            Reporter: Markus Tippmann
>         Attachments: stacktrace.txt
>
>
> We are using dependencyManagement with "import" scope like described here:
> http://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html#Importing_Dependencies
> Problem occurs only at site generation, not at build time, where it works perfectly.
> The site plugin tries to find the imported artifacts, but searches only the central repository and ignores the repositories in settings.xml configuration. Mirror settings work, if "central" is mirrored, but dependencies need to be resolved from two repositories, so one mirror does not help here.
> I try to attach the relevant parts of the stacktrace.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://jira.codehaus.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

       
Loading...