You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by hb...@apache.org on 2022/01/06 20:24:32 UTC

[maven] branch MNG-7263 updated (654a41e -> 363a528)

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

hboutemy pushed a change to branch MNG-7263
in repository https://gitbox.apache.org/repos/asf/maven.git.


 discard 654a41e  [MNG-7263] improve AbstractLifecycleProvider
     new 363a528  [MNG-7263] improve AbstractLifecycleProvider

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   (654a41e)
            \
             N -- N -- N   refs/heads/MNG-7263 (363a528)

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:
 .../apache/maven/lifecycle/providers/AbstractLifecycleProvider.java   | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

[maven] 01/01: [MNG-7263] improve AbstractLifecycleProvider

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

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

commit 363a5286d65efc9b354a27e9ad0b1550ba31715d
Author: Hervé Boutemy <hb...@apache.org>
AuthorDate: Thu Jan 6 21:21:34 2022 +0100

    [MNG-7263] improve AbstractLifecycleProvider
---
 .../lifecycle/providers/AbstractLifecycleProvider.java      | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/maven-core/src/main/java/org/apache/maven/lifecycle/providers/AbstractLifecycleProvider.java b/maven-core/src/main/java/org/apache/maven/lifecycle/providers/AbstractLifecycleProvider.java
index eb80a58..ca79d2e 100644
--- a/maven-core/src/main/java/org/apache/maven/lifecycle/providers/AbstractLifecycleProvider.java
+++ b/maven-core/src/main/java/org/apache/maven/lifecycle/providers/AbstractLifecycleProvider.java
@@ -41,11 +41,18 @@ public abstract class AbstractLifecycleProvider
         HashMap<String, LifecyclePhase> defaultBindings = null;
         if ( pluginBindings != null )
         {
-            int len = pluginBindings.length;
+            final int len = pluginBindings.length;
+
+            if ( len < 1 || len % 2 != 0 )
+            {
+                throw new IllegalArgumentException( "Plugin bindings must have more than 0, even count of elements" );
+            }
+
             defaultBindings = new HashMap<>();
-            for ( int i = 0; i < len; i++ )
+
+            for ( int i = 0; i < len; i += 2 )
             {
-                defaultBindings.put( pluginBindings[i++], new LifecyclePhase( pluginBindings[i] ) );
+                defaultBindings.put( pluginBindings[i], new LifecyclePhase( pluginBindings[i + 1] ) );
             }
         }