maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jvan...@apache.org
Subject svn commit: r769969 - in /maven/components/branches/MNG-2766: maven-compat/src/main/java/org/apache/maven/artifact/resolver/ maven-core/src/main/java/org/apache/maven/plugin/ maven-core/src/main/java/org/apache/maven/project/
Date Wed, 29 Apr 2009 22:22:57 GMT
Author: jvanzyl
Date: Wed Apr 29 22:22:57 2009
New Revision: 769969

URL: http://svn.apache.org/viewvc?rev=769969&view=rev
Log:
o resolving dependencies of a root artifact is now the job of ... the artifact resolver!

Modified:
    maven/components/branches/MNG-2766/maven-compat/src/main/java/org/apache/maven/artifact/resolver/ArtifactResolutionRequest.java
    maven/components/branches/MNG-2766/maven-compat/src/main/java/org/apache/maven/artifact/resolver/DefaultArtifactResolver.java
    maven/components/branches/MNG-2766/maven-core/src/main/java/org/apache/maven/plugin/DefaultPluginManager.java
    maven/components/branches/MNG-2766/maven-core/src/main/java/org/apache/maven/project/DefaultMavenProjectBuilder.java

Modified: maven/components/branches/MNG-2766/maven-compat/src/main/java/org/apache/maven/artifact/resolver/ArtifactResolutionRequest.java
URL: http://svn.apache.org/viewvc/maven/components/branches/MNG-2766/maven-compat/src/main/java/org/apache/maven/artifact/resolver/ArtifactResolutionRequest.java?rev=769969&r1=769968&r2=769969&view=diff
==============================================================================
--- maven/components/branches/MNG-2766/maven-compat/src/main/java/org/apache/maven/artifact/resolver/ArtifactResolutionRequest.java
(original)
+++ maven/components/branches/MNG-2766/maven-compat/src/main/java/org/apache/maven/artifact/resolver/ArtifactResolutionRequest.java
Wed Apr 29 22:22:57 2009
@@ -45,6 +45,8 @@
     private TransferListener transferListener;
     
     private boolean resolveRoot = true;
+
+    private boolean resolveDependencies = false;
     
     public ArtifactResolutionRequest()
     {  
@@ -175,6 +177,18 @@
     {
         return resolveRoot;
     }        
+
+    public ArtifactResolutionRequest setResolveDependencies( boolean resolveDependencies
)
+    {
+        this.resolveDependencies = resolveDependencies;
+        
+        return this;
+    }
+    
+    public boolean isResolveDependencies()
+    {
+        return resolveDependencies;
+    }        
     
     public TransferListener getTransferListener()
     {

Modified: maven/components/branches/MNG-2766/maven-compat/src/main/java/org/apache/maven/artifact/resolver/DefaultArtifactResolver.java
URL: http://svn.apache.org/viewvc/maven/components/branches/MNG-2766/maven-compat/src/main/java/org/apache/maven/artifact/resolver/DefaultArtifactResolver.java?rev=769969&r1=769968&r2=769969&view=diff
==============================================================================
--- maven/components/branches/MNG-2766/maven-compat/src/main/java/org/apache/maven/artifact/resolver/DefaultArtifactResolver.java
(original)
+++ maven/components/branches/MNG-2766/maven-compat/src/main/java/org/apache/maven/artifact/resolver/DefaultArtifactResolver.java
Wed Apr 29 22:22:57 2009
@@ -27,6 +27,7 @@
 import org.apache.maven.artifact.factory.ArtifactFactory;
 import org.apache.maven.artifact.manager.WagonManager;
 import org.apache.maven.artifact.metadata.ArtifactMetadata;
+import org.apache.maven.artifact.metadata.ArtifactMetadataRetrievalException;
 import org.apache.maven.artifact.metadata.ArtifactMetadataSource;
 import org.apache.maven.artifact.repository.ArtifactRepository;
 import org.apache.maven.artifact.repository.metadata.Metadata;
@@ -420,6 +421,20 @@
             }
         }
         
+        if ( request.isResolveDependencies() )
+        {
+            try
+            {                
+                artifacts = source.retrieve( rootArtifact, localRepository, remoteRepositories
).getArtifacts();
+            }
+            catch ( ArtifactMetadataRetrievalException e )
+            {
+                e.printStackTrace();
+                // need to add metadata resolution exception
+                return result;
+            }
+        }
+        
         if ( artifacts == null || artifacts.size() == 0 )
         {
             result.addArtifact( rootArtifact );            

Modified: maven/components/branches/MNG-2766/maven-core/src/main/java/org/apache/maven/plugin/DefaultPluginManager.java
URL: http://svn.apache.org/viewvc/maven/components/branches/MNG-2766/maven-core/src/main/java/org/apache/maven/plugin/DefaultPluginManager.java?rev=769969&r1=769968&r2=769969&view=diff
==============================================================================
--- maven/components/branches/MNG-2766/maven-core/src/main/java/org/apache/maven/plugin/DefaultPluginManager.java
(original)
+++ maven/components/branches/MNG-2766/maven-core/src/main/java/org/apache/maven/plugin/DefaultPluginManager.java
Wed Apr 29 22:22:57 2009
@@ -214,7 +214,7 @@
                 // Not going to happen
             }
         }
-
+        
         try
         {
             logger.debug( "Discovering components in realm: " + pluginRealm );
@@ -312,8 +312,9 @@
             .setRemoteRepostories( new ArrayList( project.getRemoteArtifactRepositories()
) )
             .setManagedVersionMap( pluginManagedDependencies )
             .setFilter( filter )
+            .setResolveDependencies( true )
             .setResolveRoot( true ); // We are setting this to false because the artifact
itself has been resolved.
-
+        
         ArtifactResolutionResult result = repositorySystem.resolve( request );
         resolutionErrorHandler.throwErrors( request, result );
 

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=769969&r1=769968&r2=769969&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
Wed Apr 29 22:22:57 2009
@@ -91,13 +91,6 @@
     @Requirement
     private ResolutionErrorHandler resolutionErrorHandler;    
 
-    //DO NOT USE, it is here only for backward compatibility reasons. The existing
-    // maven-assembly-plugin (2.2-beta-1) is accessing it via reflection.
-
-    // the aspect weaving seems not to work for reflection from plugin.
-
-    private Map processedProjectCache = new HashMap();
-
     private static HashMap<String, MavenProject> hm = new HashMap<String, MavenProject>();
 
     private MavenProject superProject;



Mime
View raw message