You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by cz...@apache.org on 2020/10/07 13:39:31 UTC

[sling-slingfeature-maven-plugin] branch master updated: SLING-9801 : Add option to continue build with analyser errors

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

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


The following commit(s) were added to refs/heads/master by this push:
     new 0f9cb23  SLING-9801 : Add option to continue build with analyser errors
0f9cb23 is described below

commit 0f9cb23510f43ccf7800b8eeee423bb290ad8757
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Wed Oct 7 15:39:07 2020 +0200

    SLING-9801 : Add option to continue build with analyser errors
---
 src/it/analyzer-errors-detected/verify.bsh                     |  2 +-
 .../apache/sling/feature/maven/mojos/AnalyseFeaturesMojo.java  | 10 ++++++++--
 2 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/src/it/analyzer-errors-detected/verify.bsh b/src/it/analyzer-errors-detected/verify.bsh
index 9c62b8c..ee9eb5d 100644
--- a/src/it/analyzer-errors-detected/verify.bsh
+++ b/src/it/analyzer-errors-detected/verify.bsh
@@ -24,7 +24,7 @@ import org.codehaus.plexus.util.*;
         File file = new File(basedir, "build.log");
         String log = FileUtils.fileRead(file);
 
-        if (log.indexOf("One or more feature analyzer(s) detected feature error(s), please read the plugin log for more details") < 0) {
+        if (log.indexOf("One or more feature analyser(s) detected feature error(s), please read the plugin log for more details") < 0) {
             System.out.println( "FAILED!" );
             return false;
         }
diff --git a/src/main/java/org/apache/sling/feature/maven/mojos/AnalyseFeaturesMojo.java b/src/main/java/org/apache/sling/feature/maven/mojos/AnalyseFeaturesMojo.java
index 4bb08a1..c6b3741 100644
--- a/src/main/java/org/apache/sling/feature/maven/mojos/AnalyseFeaturesMojo.java
+++ b/src/main/java/org/apache/sling/feature/maven/mojos/AnalyseFeaturesMojo.java
@@ -80,6 +80,9 @@ public class AnalyseFeaturesMojo extends AbstractIncludingFeatureMojo {
     @Parameter(defaultValue = "true")
     private boolean logWarnings;
 
+    @Parameter(defaultValue = "true", property = "failon.analyser.errors")
+    private boolean failOnAnalyserErrors;
+
     @Override
     public void execute() throws MojoExecutionException, MojoFailureException {
         checkPreconditions();
@@ -195,8 +198,11 @@ public class AnalyseFeaturesMojo extends AbstractIncludingFeatureMojo {
             }
         }
         if (hasErrors) {
-            throw new MojoFailureException(
-                    "One or more feature analyzer(s) detected feature error(s), please read the plugin log for more details");
+            if ( failOnAnalyserErrors ) {
+                throw new MojoFailureException(
+                    "One or more feature analyser(s) detected feature error(s), please read the plugin log for more details");
+            }
+            getLog().warn("Errors found during analyser run, but this plugin is configured to ignore errors and continue the build!");
         }
     }