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

hboutemy pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/maven-dist-tool.git


The following commit(s) were added to refs/heads/master by this push:
     new d20a034  dump content only on error, not warn
d20a034 is described below

commit d20a034caa4babbf87586726c637033f262041a0
Author: Hervé Boutemy <hbout...@apache.org>
AuthorDate: Sun May 10 15:31:54 2020 +0200

    dump content only on error, not warn
---
 .../maven/dist/tools/AbstractDistCheckMojo.java    | 25 +++++++++++-----------
 .../tools/source/DistCheckSourceReleaseMojo.java   | 10 ++++++---
 2 files changed, 20 insertions(+), 15 deletions(-)

diff --git 
a/src/main/java/org/apache/maven/dist/tools/AbstractDistCheckMojo.java 
b/src/main/java/org/apache/maven/dist/tools/AbstractDistCheckMojo.java
index b0b0e68..611170a 100644
--- a/src/main/java/org/apache/maven/dist/tools/AbstractDistCheckMojo.java
+++ b/src/main/java/org/apache/maven/dist/tools/AbstractDistCheckMojo.java
@@ -396,27 +396,28 @@ public abstract class AbstractDistCheckMojo
      * @param version The version.
      * @param ignore the list of ignores.
      * @param message  The message.
+     * @return true if real error, or false if ignored
      */
-    protected void addErrorLine( ConfigurationLineInfo cli, String version, 
List<String> ignore, String message ) 
+    protected boolean addErrorLine( ConfigurationLineInfo cli, String version, 
List<String> ignore, String message ) 
     {
         if ( ( ignore != null )
             && ( ignore.contains( cli.getArtifactId() + ':' + version ) || 
ignore.contains( cli.getArtifactId() ) ) )
         {
             getLog().warn( message );
+            return false;
         }
-        else
-        {
-            getLog().error( message );
 
-            try ( PrintWriter output = new PrintWriter( new FileWriter( 
getFailuresFile(), true ) ) )
-            {
-                output.printf( "%s%s", message, EOL );
-            }
-            catch ( Exception e )
-            {
-                getLog().error( "Cannot append to " + getFailuresFilename() );
-            }
+        getLog().error( message );
+
+        try ( PrintWriter output = new PrintWriter( new FileWriter( 
getFailuresFile(), true ) ) )
+        {
+            output.printf( "%s%s", message, EOL );
+        }
+        catch ( Exception e )
+        {
+            getLog().error( "Cannot append to " + getFailuresFilename() );
         }
+        return true;
     }
 
     private File getFailuresFile()
diff --git 
a/src/main/java/org/apache/maven/dist/tools/source/DistCheckSourceReleaseMojo.java
 
b/src/main/java/org/apache/maven/dist/tools/source/DistCheckSourceReleaseMojo.java
index 617140a..1491e60 100644
--- 
a/src/main/java/org/apache/maven/dist/tools/source/DistCheckSourceReleaseMojo.java
+++ 
b/src/main/java/org/apache/maven/dist/tools/source/DistCheckSourceReleaseMojo.java
@@ -522,13 +522,17 @@ public class DistCheckSourceReleaseMojo
 
         if ( !missingFiles.isEmpty() )
         {
-            addErrorLine( cli, version, ignoreDistFailures, "Missing file for 
" + cli.getArtifactId() + " in " + url );
+            boolean error = addErrorLine( cli, version, ignoreDistFailures,
+                                          "Missing file for " + 
cli.getArtifactId() + " in " + url );
             for ( String sourceItem : missingFiles )
             {
                 addErrorLine( cli, version, ignoreDistFailures, " > " + 
sourceItem + " <" );
             }
-            getLog().warn( "==> when reading " + url + " got following hrefs: 
" + retrievedFiles );
-            getLog().warn( url + " = " + read( url ) );
+            if ( error )
+            {
+                getLog().warn( "==> when reading " + url + " got following 
hrefs: " + retrievedFiles );
+                getLog().warn( url + " = " + read( url ) );
+            }
         }
 
         return missingFiles;

Reply via email to