maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rfscho...@apache.org
Subject svn commit: r1687631 - in /maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency: GetMojo.java tree/TreeMojo.java
Date Thu, 25 Jun 2015 20:14:45 GMT
Author: rfscholte
Date: Thu Jun 25 20:14:45 2015
New Revision: 1687631

URL: http://svn.apache.org/r1687631
Log:
[MDEP-494] Remove/replace Maven2 specific code
switch to new signatures DependencyGraphBuilder/ArtifactResolver

Modified:
    maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/GetMojo.java
    maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/tree/TreeMojo.java

Modified: maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/GetMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/GetMojo.java?rev=1687631&r1=1687630&r2=1687631&view=diff
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/GetMojo.java
(original)
+++ maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/GetMojo.java
Thu Jun 25 20:14:45 2015
@@ -39,6 +39,8 @@ import org.apache.maven.plugin.MojoFailu
 import org.apache.maven.plugins.annotations.Component;
 import org.apache.maven.plugins.annotations.Mojo;
 import org.apache.maven.plugins.annotations.Parameter;
+import org.apache.maven.project.DefaultProjectBuildingRequest;
+import org.apache.maven.project.ProjectBuildingRequest;
 import org.apache.maven.shared.artifact.resolve.ArtifactResolver;
 import org.apache.maven.shared.artifact.resolve.ArtifactResolverException;
 import org.codehaus.plexus.util.StringUtils;
@@ -220,15 +222,20 @@ public class GetMojo
 
         try
         {
+            ProjectBuildingRequest buildingRequest =
+                new DefaultProjectBuildingRequest( session.getProjectBuildingRequest() );
+            
+            buildingRequest.setRemoteRepositories( repoList );
+            
             if ( transitive )
             {
                 getLog().info( "Resolving " + toDownload + " with transitive dependencies"
);
-                artifactResolver.resolveTransitively( session.getProjectBuildingRequest(),
toDownload,  repoList );
+                artifactResolver.resolveTransitively( buildingRequest, toDownload );
             }
             else
             {
                 getLog().info( "Resolving " + toDownload );
-                artifactResolver.resolveArtifact( session.getProjectBuildingRequest(), toDownload,
 repoList );
+                artifactResolver.resolveArtifact( buildingRequest, toDownload );
             }
         }
         catch ( ArtifactResolverException e )

Modified: maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/tree/TreeMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/tree/TreeMojo.java?rev=1687631&r1=1687630&r2=1687631&view=diff
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/tree/TreeMojo.java
(original)
+++ maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/tree/TreeMojo.java
Thu Jun 25 20:14:45 2015
@@ -42,7 +42,9 @@ import org.apache.maven.plugins.annotati
 import org.apache.maven.plugins.annotations.Mojo;
 import org.apache.maven.plugins.annotations.Parameter;
 import org.apache.maven.plugins.annotations.ResolutionScope;
+import org.apache.maven.project.DefaultProjectBuildingRequest;
 import org.apache.maven.project.MavenProject;
+import org.apache.maven.project.ProjectBuildingRequest;
 import org.apache.maven.shared.artifact.filter.StrictPatternExcludesArtifactFilter;
 import org.apache.maven.shared.artifact.filter.StrictPatternIncludesArtifactFilter;
 import org.apache.maven.shared.dependency.graph.DependencyGraphBuilder;
@@ -246,9 +248,14 @@ public class TreeMojo
                 getLog().info( "Verbose not supported since maven-dependency-plugin 3.0"
);
             }
             
+            ProjectBuildingRequest buildingRequest =
+                new DefaultProjectBuildingRequest( session.getProjectBuildingRequest() );
+            
+            buildingRequest.setProject( project );
+            
             // non-verbose mode use dependency graph component, which gives consistent results
with Maven version
             // running
-            rootNode = dependencyGraphBuilder.buildDependencyGraph( project, artifactFilter
);
+            rootNode = dependencyGraphBuilder.buildDependencyGraph( buildingRequest, artifactFilter
);
 
             dependencyTreeString = serializeDependencyTree( rootNode );
 



Mime
View raw message