From f1ed6592b1c701834d1377fade6cdb382a63bbf4 Mon Sep 17 00:00:00 2001 From: Mario Krizmanic Date: Tue, 15 Aug 2017 21:46:29 +0200 Subject: [PATCH] [MNG-6127] Fix plugin execution configuration interference Signed-off-by: rfscholte --- .../internal/DefaultLifecyclePluginAnalyzer.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/maven-core/src/main/java/org/apache/maven/lifecycle/internal/DefaultLifecyclePluginAnalyzer.java b/maven-core/src/main/java/org/apache/maven/lifecycle/internal/DefaultLifecyclePluginAnalyzer.java index aec785faec..14653b7d25 100644 --- a/maven-core/src/main/java/org/apache/maven/lifecycle/internal/DefaultLifecyclePluginAnalyzer.java +++ b/maven-core/src/main/java/org/apache/maven/lifecycle/internal/DefaultLifecyclePluginAnalyzer.java @@ -31,6 +31,7 @@ import org.codehaus.plexus.component.annotations.Component; import org.codehaus.plexus.component.annotations.Requirement; import org.codehaus.plexus.logging.Logger; import org.codehaus.plexus.util.StringUtils; +import org.codehaus.plexus.util.xml.Xpp3Dom; import java.util.ArrayList; import java.util.Collections; @@ -190,8 +191,13 @@ public class DefaultLifecyclePluginAnalyzer execution.setPhase( phase ); execution.setPriority( i - mojos.size() ); execution.getGoals().add( gs.goal ); - execution.setConfiguration( mojo.getConfiguration() ); - + + Xpp3Dom lifecycleConfiguration = mojo.getConfiguration(); + if ( lifecycleConfiguration != null ) + { + execution.setConfiguration( new Xpp3Dom( lifecycleConfiguration ) ); + } + plugin.setDependencies( mojo.getDependencies() ); plugin.getExecutions().add( execution ); }