You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by mi...@apache.org on 2023/02/03 20:44:27 UTC

[maven-artifact-plugin] branch MARTIFACT-38 updated (019ce64 -> acc0cdb)

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

michaelo pushed a change to branch MARTIFACT-38
in repository https://gitbox.apache.org/repos/asf/maven-artifact-plugin.git


    omit 019ce64  Make failure configurable
    omit ce29da1  [MARTIFACT-38] Show failure reason and fail build if a plugin is marked as "fail"
     add 79da42f  [MARTIFACT-32] Add new plugins issues/fixes
     add d13ce02  [MARTIFACT-35] Compare goal should fail build when comparison was unsuccessful
     new acc0cdb  [MARTIFACT-38] Show failure reason and fail build if a plugin is marked as "fail"

This update added new revisions after undoing existing revisions.
That is to say, some revisions that were in the old version of the
branch are not in the new version.  This situation occurs
when a user --force pushes a change and generates a repository
containing something like this:

 * -- * -- B -- O -- O -- O   (019ce64)
            \
             N -- N -- N   refs/heads/MARTIFACT-38 (acc0cdb)

You should already have received notification emails for all of the O
revisions, and so the following emails describe only the N revisions
from the common base, B.

Any revisions marked "omit" are not gone; other references still
refer to them.  Any revisions marked "discard" are gone forever.

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 src/it/compare-mono/invoker.properties                  |  1 +
 .../maven/plugins/artifact/buildinfo/CompareMojo.java   | 17 +++++++++++------
 .../buildinfo/not-reproducible-plugins.properties       | 13 +++++++------
 src/site/apt/plugin-issues.apt                          | 10 +++++-----
 4 files changed, 24 insertions(+), 17 deletions(-)


[maven-artifact-plugin] 01/01: [MARTIFACT-38] Show failure reason and fail build if a plugin is marked as "fail"

Posted by mi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

michaelo pushed a commit to branch MARTIFACT-38
in repository https://gitbox.apache.org/repos/asf/maven-artifact-plugin.git

commit acc0cdb44f9e395c3cec995b270af7e728a70a1d
Author: Michael Osipov <mi...@apache.org>
AuthorDate: Wed Feb 1 15:29:22 2023 +0100

    [MARTIFACT-38] Show failure reason and fail build if a plugin is marked as "fail"
    
    This closes #10
---
 .../artifact/buildinfo/CheckBuildPlanMojo.java     | 38 ++++++++++++++++++++--
 1 file changed, 35 insertions(+), 3 deletions(-)

diff --git a/src/main/java/org/apache/maven/plugins/artifact/buildinfo/CheckBuildPlanMojo.java b/src/main/java/org/apache/maven/plugins/artifact/buildinfo/CheckBuildPlanMojo.java
index 94e8362..e9dfee5 100644
--- a/src/main/java/org/apache/maven/plugins/artifact/buildinfo/CheckBuildPlanMojo.java
+++ b/src/main/java/org/apache/maven/plugins/artifact/buildinfo/CheckBuildPlanMojo.java
@@ -85,6 +85,12 @@ public class CheckBuildPlanMojo
     @Parameter( property = "check.plugin-issues" )
     private File pluginIssues;
 
+    /**
+     * Make build fail if execution plan contains non-reproducible plugins.
+     */
+    @Parameter( property = "check.failOnNonReproducible", defaultValue = "true" )
+    private boolean failOnNonReproducible;
+
     protected MavenExecutionPlan calculateExecutionPlan()
         throws MojoExecutionException
     {
@@ -125,7 +131,17 @@ public class CheckBuildPlanMojo
                 }
                 else if ( issue.startsWith( "fail:" ) )
                 {
-                    getLog().warn( "plugin without solution " + id );
+                    String logMessage = "plugin without solution " + id + ", see " + issue.substring( 5 );
+                    if ( failOnNonReproducible )
+                    {
+                        getLog().error( logMessage );
+                    }
+                    else
+                    {
+                        getLog().warn( logMessage );
+                    }
+                    fail = true;
+
                 }
                 else
                 {
@@ -133,7 +149,15 @@ public class CheckBuildPlanMojo
                     ArtifactVersion version = new DefaultArtifactVersion( plugin.getVersion() );
                     if ( version.compareTo( minimum ) < 0 )
                     {
-                        getLog().error( "plugin with non-reproducible output: " + id + ", require minimum " + issue );
+                        String logMessage = "plugin with non-reproducible output: " + id + ", require minimum " + issue;
+                        if ( failOnNonReproducible )
+                        {
+                            getLog().error( logMessage );
+                        }
+                        else
+                        {
+                            getLog().warn( logMessage );
+                        }
                         fail = true;
                     }
                     else
@@ -157,7 +181,15 @@ public class CheckBuildPlanMojo
                 }
                 getLog().info( "        parent pom.xml is " + parent.getBasedir() + "/pom.xml" );
             }
-            throw new MojoExecutionException( "non-reproducible plugin or configuration found with fix available" );
+            String message = "non-reproducible plugin or configuration found with fix available";
+            if ( failOnNonReproducible )
+            {
+                throw new MojoExecutionException( message );
+            }
+            else
+            {
+                getLog().warn( message );
+            }
         }
     }