maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bentm...@apache.org
Subject svn commit: r778127 - /maven/components/branches/MNG-2766/maven-core/src/main/java/org/apache/maven/project/DefaultMavenProjectBuilder.java
Date Sun, 24 May 2009 12:12:38 GMT
Author: bentmann
Date: Sun May 24 12:12:38 2009
New Revision: 778127

URL: http://svn.apache.org/viewvc?rev=778127&view=rev
Log:
o Fixed parent resolution from settings' repositories

Modified:
    maven/components/branches/MNG-2766/maven-core/src/main/java/org/apache/maven/project/DefaultMavenProjectBuilder.java

Modified: maven/components/branches/MNG-2766/maven-core/src/main/java/org/apache/maven/project/DefaultMavenProjectBuilder.java
URL: http://svn.apache.org/viewvc/maven/components/branches/MNG-2766/maven-core/src/main/java/org/apache/maven/project/DefaultMavenProjectBuilder.java?rev=778127&r1=778126&r2=778127&view=diff
==============================================================================
--- maven/components/branches/MNG-2766/maven-core/src/main/java/org/apache/maven/project/DefaultMavenProjectBuilder.java
(original)
+++ maven/components/branches/MNG-2766/maven-core/src/main/java/org/apache/maven/project/DefaultMavenProjectBuilder.java
Sun May 24 12:12:38 2009
@@ -38,6 +38,7 @@
 import org.apache.maven.model.ModelEventListener;
 import org.apache.maven.model.ProcessorContext;
 import org.apache.maven.model.Profile;
+import org.apache.maven.model.Repository;
 import org.apache.maven.model.interpolator.Interpolator;
 import org.apache.maven.model.io.xpp3.MavenXpp3Reader;
 import org.apache.maven.model.lifecycle.LifecycleBindingsInjector;
@@ -387,8 +388,35 @@
         List<DomainModel> domainModels = new ArrayList<DomainModel>();
 
         domainModels.add( domainModel );
+
         ArtifactRepository localRepository = projectBuilderConfiguration.getLocalRepository();
-        List<ArtifactRepository> remoteRepositories = projectBuilderConfiguration.getRemoteRepositories();
+
+        List<ArtifactRepository> remoteRepositories = new ArrayList<ArtifactRepository>();
+        try
+        {
+            for ( Profile profile : profileSelector.getActiveProfiles( projectBuilderConfiguration.getProfiles(),
+                                                                       projectBuilderConfiguration
) )
+            {
+                for ( Repository repository : profile.getRepositories() )
+                {
+                    try
+                    {
+                        remoteRepositories.add( repositorySystem.buildArtifactRepository(
repository ) );
+                    }
+                    catch ( InvalidRepositoryException e )
+                    {
+                        throw new ProjectBuildingException( projectId, "Failed to create
remote repository "
+                            + repository, pomFile, e );
+                    }
+                }
+            }
+            remoteRepositories = repositorySystem.getMirrors( remoteRepositories );
+        }
+        catch ( ProfileActivationException e )
+        {
+            throw new ProjectBuildingException( projectId, "Failed to determine active profiles",
pomFile, e );
+        }
+        remoteRepositories.addAll( projectBuilderConfiguration.getRemoteRepositories() );
 
         File parentFile = null;
         int lineageCount = 0;



Mime
View raw message