maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jvan...@apache.org
Subject svn commit: r750152 - in /maven/components/trunk: maven-core/src/main/java/org/apache/maven/plugin/ maven-project/src/main/java/org/apache/maven/project/
Date Wed, 04 Mar 2009 20:53:38 GMT
Author: jvanzyl
Date: Wed Mar  4 20:53:37 2009
New Revision: 750152

URL: http://svn.apache.org/viewvc?rev=750152&view=rev
Log:
o use the remote repos processed by the request

Modified:
    maven/components/trunk/maven-core/src/main/java/org/apache/maven/plugin/DefaultPluginManager.java
    maven/components/trunk/maven-core/src/main/java/org/apache/maven/plugin/DefaultPluginManagerSupport.java
    maven/components/trunk/maven-project/src/main/java/org/apache/maven/project/DefaultMavenProjectBuilder.java

Modified: maven/components/trunk/maven-core/src/main/java/org/apache/maven/plugin/DefaultPluginManager.java
URL: http://svn.apache.org/viewvc/maven/components/trunk/maven-core/src/main/java/org/apache/maven/plugin/DefaultPluginManager.java?rev=750152&r1=750151&r2=750152&view=diff
==============================================================================
--- maven/components/trunk/maven-core/src/main/java/org/apache/maven/plugin/DefaultPluginManager.java
(original)
+++ maven/components/trunk/maven-core/src/main/java/org/apache/maven/plugin/DefaultPluginManager.java
Wed Mar  4 20:53:37 2009
@@ -98,7 +98,6 @@
 import org.codehaus.plexus.configuration.PlexusConfiguration;
 import org.codehaus.plexus.configuration.PlexusConfigurationException;
 import org.codehaus.plexus.configuration.xml.XmlPlexusConfiguration;
-import org.codehaus.plexus.logging.AbstractLogEnabled;
 import org.codehaus.plexus.logging.Logger;
 import org.codehaus.plexus.util.StringUtils;
 import org.codehaus.plexus.util.xml.Xpp3Dom;
@@ -170,23 +169,15 @@
     //
     // ----------------------------------------------------------------------
 
-    public Plugin getPluginDefinitionForPrefix( String prefix,
-                                                MavenSession session,
-                                                MavenProject project )
+    public Plugin getPluginDefinitionForPrefix( String prefix, MavenSession session, MavenProject
project )
     {
         // TODO: since this is only used in the lifecycle executor, maybe it should be moved
there? There is no other
         // use for the mapping manager in here
-        return pluginMappingManager.getByPrefix( prefix, session.getPluginGroups(),
-                                                 project.getRemoteArtifactRepositories(),
-                                                 session.getLocalRepository() );
+        return pluginMappingManager.getByPrefix( prefix, session.getPluginGroups(), project.getRemoteArtifactRepositories(),
session.getLocalRepository() );
     }
 
-    public PluginDescriptor verifyPlugin( Plugin plugin,
-                                          MavenProject project,
-                                          MavenSession session )
-        throws ArtifactResolutionException, PluginVersionResolutionException,
-        ArtifactNotFoundException, InvalidPluginException,
-        PluginManagerException, PluginNotFoundException, PluginVersionNotFoundException
+    public PluginDescriptor verifyPlugin( Plugin plugin, MavenProject project, MavenSession
session )
+        throws ArtifactResolutionException, PluginVersionResolutionException, ArtifactNotFoundException,
InvalidPluginException, PluginManagerException, PluginNotFoundException, PluginVersionNotFoundException
     {
         String pluginVersion = plugin.getVersion();
 

Modified: maven/components/trunk/maven-core/src/main/java/org/apache/maven/plugin/DefaultPluginManagerSupport.java
URL: http://svn.apache.org/viewvc/maven/components/trunk/maven-core/src/main/java/org/apache/maven/plugin/DefaultPluginManagerSupport.java?rev=750152&r1=750151&r2=750152&view=diff
==============================================================================
--- maven/components/trunk/maven-core/src/main/java/org/apache/maven/plugin/DefaultPluginManagerSupport.java
(original)
+++ maven/components/trunk/maven-core/src/main/java/org/apache/maven/plugin/DefaultPluginManagerSupport.java
Wed Mar  4 20:53:37 2009
@@ -78,11 +78,8 @@
 
     private Context containerContext;
 
-    public Artifact resolvePluginArtifact( Plugin plugin,
-                                           MavenProject project,
-                                           MavenSession session )
-        throws PluginManagerException, InvalidPluginException, PluginVersionResolutionException,
-        ArtifactResolutionException, ArtifactNotFoundException
+    public Artifact resolvePluginArtifact( Plugin plugin, MavenProject project, MavenSession
session )
+        throws PluginManagerException, InvalidPluginException, PluginVersionResolutionException,
ArtifactResolutionException, ArtifactNotFoundException
     {
         ArtifactRepository localRepository = session.getLocalRepository();
 
@@ -102,12 +99,9 @@
 
         if(pluginProject == null)
         {
-            pluginProject = buildPluginProject( plugin,
-                                                localRepository,
-                                                remoteRepositories );
+            pluginProject = buildPluginProject( plugin, localRepository, remoteRepositories
);
         }
 
-
         checkRequiredMavenVersion( plugin, pluginProject, localRepository, remoteRepositories
);
 
         checkPluginDependencySpec( plugin, pluginProject );
@@ -116,8 +110,7 @@
 
         pluginArtifact = project.replaceWithActiveArtifact( pluginArtifact );
 
-        ArtifactResolutionRequest request =
-            new ArtifactResolutionRequest( pluginArtifact, localRepository, remoteRepositories
);
+        ArtifactResolutionRequest request = new ArtifactResolutionRequest( pluginArtifact,
localRepository, remoteRepositories );
         ArtifactResolutionResult result = repositorySystem.resolve( request );
         resolutionErrorHandler.throwErrors( request, result );
 
@@ -130,9 +123,7 @@
         Artifact artifact = repositorySystem.createProjectArtifact( plugin.getGroupId(),
plugin.getArtifactId(), plugin.getVersion() );
         try
         {
-            return mavenProjectBuilder.buildFromRepository( artifact,
-                                                            remoteRepositories,
-                                                            localRepository );
+            return mavenProjectBuilder.buildFromRepository( artifact, remoteRepositories,
localRepository );
         }
         catch ( ProjectBuildingException e )
         {

Modified: maven/components/trunk/maven-project/src/main/java/org/apache/maven/project/DefaultMavenProjectBuilder.java
URL: http://svn.apache.org/viewvc/maven/components/trunk/maven-project/src/main/java/org/apache/maven/project/DefaultMavenProjectBuilder.java?rev=750152&r1=750151&r2=750152&view=diff
==============================================================================
--- maven/components/trunk/maven-project/src/main/java/org/apache/maven/project/DefaultMavenProjectBuilder.java
(original)
+++ maven/components/trunk/maven-project/src/main/java/org/apache/maven/project/DefaultMavenProjectBuilder.java
Wed Mar  4 20:53:37 2009
@@ -208,7 +208,7 @@
         return buildFromRepository( artifact, remoteArtifactRepositories, localRepository
);
     }
 
-    public MavenProject buildFromRepository( Artifact artifact, List remoteArtifactRepositories,
ArtifactRepository localRepository )
+    public MavenProject buildFromRepository( Artifact artifact, List remoteRepositories,
ArtifactRepository localRepository )
         throws ProjectBuildingException
     {
         MavenProject project = hm.get( artifact.getId() );
@@ -218,7 +218,7 @@
             return project;
         }
         
-        List<ArtifactRepository> artifactRepositories = new ArrayList<ArtifactRepository>(
remoteArtifactRepositories );
+        List<ArtifactRepository> artifactRepositories = new ArrayList<ArtifactRepository>(
remoteRepositories );
         try
         {
             artifactRepositories.addAll( repositorySystem.buildArtifactRepositories( getSuperModel().getRepositories()
) );
@@ -246,7 +246,9 @@
             throw new ProjectBuildingException( artifact.getId(), "Error with repository
specified in project.", e );
         }
 
-        ProjectBuilderConfiguration config = new DefaultProjectBuilderConfiguration().setLocalRepository(
localRepository );
+        ProjectBuilderConfiguration config = new DefaultProjectBuilderConfiguration()
+            .setLocalRepository( localRepository )
+            .setRemoteRepositories( remoteRepositories );
 
         project = readModelFromLocalPath( "unknown", artifact.getFile(), config.getLocalRepository(),
artifactRepositories, config );
         project = buildWithProfiles( project.getModel(), config, artifact.getFile(), project.getParentFile()
);



Mime
View raw message