maven-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael Koch (JIRA)" <>
Subject [jira] (MSITE-640) Maven searches only central repository for imported dependencies
Date Wed, 05 Jun 2013 13:38:03 GMT


Michael Koch commented on MSITE-640:

I also spent some time debugging the code, here are my findings:

bq. the root cause seemed to be that the site plugin wasn't giving Maven the full list of
repositories to search.

I don't think the site plugin ({{DefaultSiteTool.populateModulesMenu}} from _doxia-integration-tools_)
can pass the list of repositories because the {{MavenProjectBuilder}} interface has no method
which accepts a POM file and a list of repositories. I guess adding one would be counter-productive
since the interface is deprecated.

My idea would be to fix the repository list resolution of the {{DefaultMavenProjectBuilder}}
in _maven-compat_. As far as I can see by debugging, the problem is that the list of profiles
(including the profile from the settings.xml which declares the required repository) is not
copied from the {{legacySupport MavenSession}} to the {{ProjectBuildingRequest request}}.
Therefore, even though the request contains the list of active profile IDs, the profile corresponding
to the ID cannot be found.

The issue can be fixed by copying the profiles in {{DefaultMavenProjectBuilder.injectSession}}.

diff --git a/maven-compat/src/main/java/org/apache/maven/project/
index fff2de1..fdb18ec 100644
--- a/maven-compat/src/main/java/org/apache/maven/project/
+++ b/maven-compat/src/main/java/org/apache/maven/project/
@@ -124,6 +124,7 @@ public class DefaultMavenProjectBuilder
             if ( req != null )
                 request.setRemoteRepositories( req.getRemoteRepositories() );
+                request.setProfiles(req.getProfiles());

This fixes the issue with site creation for me. However, I am not sure if this change does
not break other things. Could someone experienced with this part of the Maven core have a
look at it?
> Maven searches only central repository for imported dependencies
> ----------------------------------------------------------------
>                 Key: MSITE-640
>                 URL:
>             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:
> 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
For more information on JIRA, see:

View raw message