You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by rf...@apache.org on 2018/02/21 21:38:11 UTC

[maven-jdeps-plugin] branch master updated: [MJDEPS-9] Introduce failOnWarning as a named property

This is an automated email from the ASF dual-hosted git repository.

rfscholte pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/maven-jdeps-plugin.git


The following commit(s) were added to refs/heads/master by this push:
     new 77bbb58  [MJDEPS-9] Introduce failOnWarning as a named property
77bbb58 is described below

commit 77bbb583496c9dc83d2e69f84ba87ea19b665be4
Author: rfscholte <rf...@apache.org>
AuthorDate: Wed Feb 21 22:38:08 2018 +0100

    [MJDEPS-9] Introduce failOnWarning as a named property
---
 .../org/apache/maven/plugin/jdeps/AbstractJDepsMojo.java   |  9 +++++++--
 .../apache/maven/plugin/jdeps/TestJDKInternalsMojo.java    | 14 +++++++++++++-
 2 files changed, 20 insertions(+), 3 deletions(-)

diff --git a/src/main/java/org/apache/maven/plugin/jdeps/AbstractJDepsMojo.java b/src/main/java/org/apache/maven/plugin/jdeps/AbstractJDepsMojo.java
index 8182230..0cc0aaf 100644
--- a/src/main/java/org/apache/maven/plugin/jdeps/AbstractJDepsMojo.java
+++ b/src/main/java/org/apache/maven/plugin/jdeps/AbstractJDepsMojo.java
@@ -77,7 +77,7 @@ public abstract class AbstractJDepsMojo
     /**
      * Indicates whether the build will continue even if there are jdeps warnings.
      */
-    @Parameter( defaultValue = "true" )
+    @Parameter( defaultValue = "true", property = "jdeps.failOnWarning" )
     private boolean failOnWarning;
     
     /**
@@ -231,7 +231,7 @@ public abstract class AbstractJDepsMojo
                    .append( " -> " ).append( offendingPackage.getValue() ).append( ls );
             }
             
-            if ( failOnWarning )
+            if ( isFailOnWarning() )
             {
                 throw new MojoExecutionException( msg.toString() );
             }
@@ -578,6 +578,11 @@ public abstract class AbstractJDepsMojo
         return tc;
     }
 
+    protected boolean isFailOnWarning()
+    {
+        return failOnWarning;
+    }
+    
     protected abstract String getClassesDirectory();
     
     protected abstract Collection<Path> getClassPath() throws DependencyResolutionRequiredException;
diff --git a/src/main/java/org/apache/maven/plugin/jdeps/TestJDKInternalsMojo.java b/src/main/java/org/apache/maven/plugin/jdeps/TestJDKInternalsMojo.java
index 466f131..c7c2946 100644
--- a/src/main/java/org/apache/maven/plugin/jdeps/TestJDKInternalsMojo.java
+++ b/src/main/java/org/apache/maven/plugin/jdeps/TestJDKInternalsMojo.java
@@ -28,6 +28,7 @@ import java.util.Set;
 import org.apache.maven.artifact.DependencyResolutionRequiredException;
 import org.apache.maven.plugins.annotations.LifecyclePhase;
 import org.apache.maven.plugins.annotations.Mojo;
+import org.apache.maven.plugins.annotations.Parameter;
 import org.apache.maven.plugins.annotations.ResolutionScope;
 
 /**
@@ -42,7 +43,18 @@ import org.apache.maven.plugins.annotations.ResolutionScope;
 public class TestJDKInternalsMojo
     extends AbstractJDepsMojo
 {
-
+    /**
+     * Indicates whether the build will continue even if there are jdeps warnings.
+     */
+    @Parameter( defaultValue = "true", property = "jdeps.test.failOnWarning" )
+    private boolean failOnWarning;
+    
+    @Override
+    protected boolean isFailOnWarning()
+    {
+        return failOnWarning;
+    }
+    
     @Override
     protected String getClassesDirectory()
     {

-- 
To stop receiving notification emails like this one, please contact
rfscholte@apache.org.