continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From eveni...@apache.org
Subject svn commit: r592774 - /maven/continuum/trunk/continuum-data-management/data-management-cli/src/main/java/org/apache/maven/continuum/management/DataManagementCli.java
Date Wed, 07 Nov 2007 15:05:32 GMT
Author: evenisse
Date: Wed Nov  7 07:05:32 2007
New Revision: 592774

URL: http://svn.apache.org/viewvc?rev=592774&view=rev
Log:
[CONTINUUM-1536] Load extra repositories from settings.xml

Modified:
    maven/continuum/trunk/continuum-data-management/data-management-cli/src/main/java/org/apache/maven/continuum/management/DataManagementCli.java

Modified: maven/continuum/trunk/continuum-data-management/data-management-cli/src/main/java/org/apache/maven/continuum/management/DataManagementCli.java
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-data-management/data-management-cli/src/main/java/org/apache/maven/continuum/management/DataManagementCli.java?rev=592774&r1=592773&r2=592774&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-data-management/data-management-cli/src/main/java/org/apache/maven/continuum/management/DataManagementCli.java
(original)
+++ maven/continuum/trunk/continuum-data-management/data-management-cli/src/main/java/org/apache/maven/continuum/management/DataManagementCli.java
Wed Nov  7 07:05:32 2007
@@ -40,7 +40,9 @@
 import org.apache.maven.artifact.resolver.filter.ExcludesArtifactFilter;
 import org.apache.maven.settings.MavenSettingsBuilder;
 import org.apache.maven.settings.Mirror;
+import org.apache.maven.settings.Profile;
 import org.apache.maven.settings.Proxy;
+import org.apache.maven.settings.Repository;
 import org.apache.maven.settings.Server;
 import org.apache.maven.settings.Settings;
 import org.apache.maven.wagon.repository.RepositoryPermissions;
@@ -346,6 +348,23 @@
         List<ArtifactRepository> remoteRepositories = new ArrayList<ArtifactRepository>();
         remoteRepositories.add(
             factory.createArtifactRepository( "central", "http://repo1.maven.org/maven2",
layout, null, null ) );
+        //Load extra repositories from active profile
+        List<Profile> profiles = getSettings( container ).getActiveProfiles();
+        if ( profiles != null && !profiles.isEmpty() )
+        {
+            for ( Profile p : profiles )
+            {
+                List<Repository> repos = p.getRepositories();
+                if ( repos != null && !repos.isEmpty() )
+                {
+                    for ( Repository repo : repos )
+                    {
+                        remoteRepositories.add(
+                            factory.createArtifactRepository( repo.getId(), repo.getUrl(),
layout, null, null ) );
+                    }
+                }
+            }
+        }
 
         ArtifactFactory artifactFactory = (ArtifactFactory) container.lookup( ArtifactFactory.ROLE
);
         Artifact artifact =



Mime
View raw message