From 6b31c4a556f51cd1c2064fe773550c0acf14d307 Mon Sep 17 00:00:00 2001 From: Stuart McCulloch Date: Wed, 6 Jan 2016 11:23:06 +0000 Subject: [PATCH] [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 --- .../org/apache/maven/lifecycle/mapping/Lifecycle.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) 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 d2b6d6cd8f..c14cf94fa9 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 phases ) + public void setPhases( Map phases ) { - setLifecyclePhases( phases ); + Map lphases = new LinkedHashMap<>(); + for ( Map.Entry e: phases.entrySet() ) + { + lphases.put( e.getKey(), new LifecyclePhase( e.getValue() ) ); + } + setLifecyclePhases( lphases ); } }