You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by sc...@apache.org on 2017/01/09 23:17:24 UTC

maven git commit: [MNG-5958] restore binary compatibility of Lifecycle.setPhases

Repository: maven
Updated Branches:
  refs/heads/MNG-5958 [created] 71ada0897


[MNG-5958] restore binary compatibility of Lifecycle.setPhases

While MNG-5805 restored binary compatibility of Lifecycle.getPhases
it didn't do the same for Lifecycle.setPhases. This breaks plugins
like flexmojos-maven-plugin which have their own lifecycle mapping
implementations.

This closes #77


Project: http://git-wip-us.apache.org/repos/asf/maven/repo
Commit: http://git-wip-us.apache.org/repos/asf/maven/commit/71ada089
Tree: http://git-wip-us.apache.org/repos/asf/maven/tree/71ada089
Diff: http://git-wip-us.apache.org/repos/asf/maven/diff/71ada089

Branch: refs/heads/MNG-5958
Commit: 71ada08978c78d3b1416f0cf4f63942dddb171d9
Parents: e51fc87
Author: Stuart McCulloch <mc...@gmail.com>
Authored: Wed Jan 6 11:23:06 2016 +0000
Committer: Christian Schulte <sc...@apache.org>
Committed: Tue Jan 10 00:10:55 2017 +0100

----------------------------------------------------------------------
 .../java/org/apache/maven/lifecycle/mapping/Lifecycle.java  | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/maven/blob/71ada089/maven-core/src/main/java/org/apache/maven/lifecycle/mapping/Lifecycle.java
----------------------------------------------------------------------
diff --git a/maven-core/src/main/java/org/apache/maven/lifecycle/mapping/Lifecycle.java b/maven-core/src/main/java/org/apache/maven/lifecycle/mapping/Lifecycle.java
index d2b6d6c..c14cf94 100644
--- a/maven-core/src/main/java/org/apache/maven/lifecycle/mapping/Lifecycle.java
+++ b/maven-core/src/main/java/org/apache/maven/lifecycle/mapping/Lifecycle.java
@@ -106,8 +106,13 @@ public class Lifecycle
     }
 
     @Deprecated
-    public void setPhases( Map<String, LifecyclePhase> phases )
+    public void setPhases( Map<String, String> phases )
     {
-        setLifecyclePhases( phases );
+        Map<String, LifecyclePhase> lphases = new LinkedHashMap<>();
+        for ( Map.Entry<String, String> e: phases.entrySet() )
+        {
+            lphases.put( e.getKey(), new LifecyclePhase( e.getValue() ) );
+        }
+        setLifecyclePhases( lphases );
     }
 }