maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bri...@apache.org
Subject svn commit: r497321 - in /maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency: AbstractResolveMojo.java resolvers/ResolveDependenciesMojo.java utils/DependencyStatusSets.java
Date Thu, 18 Jan 2007 06:34:26 GMT
Author: brianf
Date: Wed Jan 17 22:34:25 2007
New Revision: 497321

URL: http://svn.apache.org/viewvc?view=rev&rev=497321
Log:
MDEP-57: dependency:resolve should output scope

Modified:
    maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/AbstractResolveMojo.java
    maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/resolvers/ResolveDependenciesMojo.java
    maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/utils/DependencyStatusSets.java

Modified: maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/AbstractResolveMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/AbstractResolveMojo.java?view=diff&rev=497321&r1=497320&r2=497321
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/AbstractResolveMojo.java
(original)
+++ maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/AbstractResolveMojo.java
Wed Jan 17 22:34:25 2007
@@ -46,6 +46,13 @@
      * @readonly
      */
     protected MavenProjectBuilder mavenProjectBuilder;
+    
+    /**
+     * If we should display the scope when resolving
+     * 
+     * @parameter expression="${mdep.outputScope}" default-value="true"
+     */
+    protected boolean outputScope;
 
     /**
      * This method resolves the dependency artifacts from the project.

Modified: maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/resolvers/ResolveDependenciesMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/resolvers/ResolveDependenciesMojo.java?view=diff&rev=497321&r1=497320&r2=497321
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/resolvers/ResolveDependenciesMojo.java
(original)
+++ maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/resolvers/ResolveDependenciesMojo.java
Wed Jan 17 22:34:25 2007
@@ -39,6 +39,14 @@
 public class ResolveDependenciesMojo
     extends AbstractResolveMojo
 {
+    
+    /**
+     * If we should display the scope when resolving
+     * 
+     * @parameter expression="${mdep.outputScope}" default-value="true"
+     * @since 2.0-alpha-2
+     */
+    protected boolean outputScope;
 
     /**
      * Only used to store results for integration test validation
@@ -59,7 +67,7 @@
         // get sets of dependencies
         results = this.getDependencySets( false );
 
-        results.logStatus( getLog(), outputAbsoluteArtifactFilename );
+        results.logStatus( getLog(), outputAbsoluteArtifactFilename, outputScope );
     }
 
     /**

Modified: maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/utils/DependencyStatusSets.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/utils/DependencyStatusSets.java?view=diff&rev=497321&r1=497320&r2=497321
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/utils/DependencyStatusSets.java
(original)
+++ maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/utils/DependencyStatusSets.java
Wed Jan 17 22:34:25 2007
@@ -139,6 +139,11 @@
 
     public void logStatus( Log log, boolean outputAbsoluteArtifactFilename )
     {
+        logStatus( log, outputAbsoluteArtifactFilename, true );
+    }
+
+    public void logStatus( Log log, boolean outputAbsoluteArtifactFilename, boolean outputScope
)
+    {
         log.info( "" );
         log.info( "The following files have been resolved: " );
         if ( this.resolvedDependencies == null || this.resolvedDependencies.isEmpty() )
@@ -164,7 +169,9 @@
                         artifactFilename = null;
                     }
                 }
-                log.info( "   " + artifact.getId() + ( outputAbsoluteArtifactFilename ? ":"
+ artifactFilename : "" ) );
+                log.info( "   " + artifact.getId()
+                    + ( outputAbsoluteArtifactFilename ? ":" + artifactFilename : "" )
+                    + ( outputScope ? " (scope = " + artifact.getScope() + ")" : "" ));
             }
         }
 



Mime
View raw message