You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by rf...@apache.org on 2020/06/23 17:37:39 UTC

[maven] branch MNG-6944 created (now a945ca4)

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

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


      at a945ca4  [MNG-6944] Fix ordering lifecycles

This branch includes the following new commits:

     new a945ca4  [MNG-6944] Fix ordering lifecycles

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.



[maven] 01/01: [MNG-6944] Fix ordering lifecycles

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

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

commit a945ca4ed314714fdc2be4616bcf34eaf6d3c1f5
Author: rfscholte <rf...@apache.org>
AuthorDate: Tue Jun 23 19:37:29 2020 +0200

    [MNG-6944] Fix ordering lifecycles
---
 .../java/org/apache/maven/lifecycle/DefaultLifecycles.java    | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/maven-core/src/main/java/org/apache/maven/lifecycle/DefaultLifecycles.java b/maven-core/src/main/java/org/apache/maven/lifecycle/DefaultLifecycles.java
index 2a1deb8..1a5b4a0 100644
--- a/maven-core/src/main/java/org/apache/maven/lifecycle/DefaultLifecycles.java
+++ b/maven-core/src/main/java/org/apache/maven/lifecycle/DefaultLifecycles.java
@@ -124,13 +124,16 @@ public class DefaultLifecycles
         
         Comparator<String> comparator = ( l, r ) -> 
         {
-            if ( lifecycleIds.contains( l ) ) 
+            int lx = lifecycleIds.indexOf( l );
+            int rx = lifecycleIds.indexOf( r );
+
+            if ( lx < 0 || rx < 0 ) 
             {
-                return lifecycleIds.indexOf( l ) - lifecycleIds.indexOf( r );      
+                return rx - lx;
             }
-            else
+            else 
             {
-                return Integer.MAX_VALUE;
+                return lx - rx;
             }
         };