maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r576433 - /maven/plugins/branches/maven-dependency-plugin-tree-1.1/src/main/java/org/apache/maven/plugin/dependency/AnalyzeMojo.java
Date Mon, 17 Sep 2007 13:43:36 GMT
Author: markh
Date: Mon Sep 17 06:43:36 2007
New Revision: 576433

URL: http://svn.apache.org/viewvc?rev=576433&view=rev
Log:
o Renamed failBuild to failOnWarning
o Improve warning logging

Modified:
    maven/plugins/branches/maven-dependency-plugin-tree-1.1/src/main/java/org/apache/maven/plugin/dependency/AnalyzeMojo.java

Modified: maven/plugins/branches/maven-dependency-plugin-tree-1.1/src/main/java/org/apache/maven/plugin/dependency/AnalyzeMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/branches/maven-dependency-plugin-tree-1.1/src/main/java/org/apache/maven/plugin/dependency/AnalyzeMojo.java?rev=576433&r1=576432&r2=576433&view=diff
==============================================================================
--- maven/plugins/branches/maven-dependency-plugin-tree-1.1/src/main/java/org/apache/maven/plugin/dependency/AnalyzeMojo.java
(original)
+++ maven/plugins/branches/maven-dependency-plugin-tree-1.1/src/main/java/org/apache/maven/plugin/dependency/AnalyzeMojo.java
Mon Sep 17 06:43:36 2007
@@ -69,11 +69,11 @@
     private ProjectDependencyAnalyzer analyzer;
 
     /**
-     * Fail Build on problem
+     * Whether to fail the build if a dependency warning is found.
      * 
-     * @parameter expression="${mdep.analyze.failBuild}" default-value="false"
+     * @parameter expression="${mdep.analyze.failOnWarning}" default-value="false"
      */
-    private boolean failBuild;
+    private boolean failOnWarning;
 
     /**
      * Output used dependencies
@@ -151,11 +151,11 @@
             return;
         }
 
-        boolean result = checkDependencies();
+        boolean warning = checkDependencies();
 
-        if ( result && this.failBuild )
+        if ( warning && failOnWarning )
         {
-            throw new MojoExecutionException( "Found Dependency errors." );
+            throw new MojoExecutionException( "Dependency problems found" );
         }
     }
 
@@ -164,7 +164,7 @@
     private boolean checkDependencies()
         throws MojoExecutionException
     {
-        boolean result = false;
+        boolean warning = false;
         try
         {
             ProjectDependencyAnalysis analysis = analyzer.analyze( project );
@@ -197,7 +197,7 @@
                     }
                 }
             }
-            logArtifacts( unusedDeclared, false );
+            logArtifacts( unusedDeclared, true );
 
             if ( outputXML )
             {
@@ -211,8 +211,7 @@
             if ( ( usedUndeclared != null && !usedUndeclared.isEmpty() ) || unusedDeclared
!= null
                             && !unusedDeclared.isEmpty() )
             {
-                getLog().warn( "Potential problems discovered." );
-                result = true;
+                warning = true;
             }
         }
         catch ( ProjectDependencyAnalyzerException exception )
@@ -220,7 +219,7 @@
             throw new MojoExecutionException( "Cannot analyze dependencies", exception );
         }
 
-        return result;
+        return warning;
     }
 
     private void logArtifacts( Set artifacts, boolean warn )



Mime
View raw message