maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dfabul...@apache.org
Subject svn commit: r689852 - /maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/GetMojo.java
Date Thu, 28 Aug 2008 15:33:19 GMT
Author: dfabulich
Date: Thu Aug 28 08:33:18 2008
New Revision: 689852

URL: http://svn.apache.org/viewvc?rev=689852&view=rev
Log:
Add an option to resolve non-transitively

Modified:
    maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/GetMojo.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=689852&r1=689851&r2=689852&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 Aug 28 08:33:18 2008
@@ -135,6 +135,12 @@
      */
     private List pomRemoteRepositories;
     
+    /**
+     * Download transitively, retrieving the specified artifact and all of its dependencies.
+     * @parameter expression="{$transitive}" default-value=true
+     */
+    private boolean transitive = true;
+    
     public void execute()
         throws MojoExecutionException, MojoFailureException
     {        
@@ -181,8 +187,16 @@
 
         try
         {
-            artifactResolver.resolveTransitively( Collections.singleton( toDownload ), dummyOriginatingArtifact,
-                                                  repoList, localRepository, source );
+            if ( transitive )
+            {
+                artifactResolver.resolveTransitively( Collections.singleton( toDownload ),
dummyOriginatingArtifact,
+                                                      repoList, localRepository, source );
+            }
+            else
+            {
+                artifactResolver.resolve ( toDownload, repoList, localRepository );
+            }
+            
         }
         catch ( AbstractArtifactResolutionException e )
         {



Mime
View raw message