dump content only on error, not warn
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 @@
* @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 @@
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;