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 d85d1af  SLING-9534 : Provide option to disable output of warnings of 
analysers
d85d1af is described below

commit d85d1af5215ae236166ba9bc6ab1f42402f19855
Author: Carsten Ziegeler <[email protected]>
AuthorDate: Fri Jun 19 13:22:15 2020 +0200

    SLING-9534 : Provide option to disable output of warnings of analysers
---
 .../feature/maven/mojos/AnalyseFeaturesMojo.java    | 21 +++++++++++++++++++--
 1 file changed, 19 insertions(+), 2 deletions(-)

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 618cc96..4bb08a1 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
@@ -59,12 +59,27 @@ public class AnalyseFeaturesMojo extends 
AbstractIncludingFeatureMojo {
 
     private static final String ANALYSER_CONFIG_WILDCARD = "all";
 
+    /**
+     * The scans for the analyser
+     */
     @Parameter
     private List<Scan> scans;
 
+    /**
+     * The framework to use for analysing the feature models if not
+     * contained in an execution-environment extension.
+     */
     @Parameter
     private Dependency framework;
 
+    /**
+     * By default the warnings from the analysers are logged. Setting this to
+     * false disables logging them.
+     * @since 1.3.8
+     */
+    @Parameter(defaultValue = "true")
+    private boolean logWarnings;
+
     @Override
     public void execute() throws MojoExecutionException, MojoFailureException {
         checkPreconditions();
@@ -149,8 +164,10 @@ public class AnalyseFeaturesMojo extends 
AbstractIncludingFeatureMojo {
                             fwk = this.framework;
                         }
                         final AnalyserResult result = analyser.analyse(f, 
ProjectHelper.toArtifactId(fwk), featureProvider);
-                        for (final String msg : result.getWarnings()) {
-                            getLog().warn(msg);
+                        if ( logWarnings ) {
+                            for (final String msg : result.getWarnings()) {
+                                getLog().warn(msg);
+                            }
                         }
                         for (final String msg : result.getErrors()) {
                             getLog().error(msg);

Reply via email to