From f5605e5327b438654e3e496521d7764bb3b96709 Mon Sep 17 00:00:00 2001 From: Brett Leslie Porter Date: Sat, 19 Mar 2005 00:22:28 +0000 Subject: [PATCH] override with goal configuration if it exists git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@163618 13f79535-47bb-0310-9956-ffa450edef68 --- .../maven/plugin/DefaultPluginManager.java | 21 ++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/maven-core/src/main/java/org/apache/maven/plugin/DefaultPluginManager.java b/maven-core/src/main/java/org/apache/maven/plugin/DefaultPluginManager.java index cbb202505a..eece374203 100644 --- a/maven-core/src/main/java/org/apache/maven/plugin/DefaultPluginManager.java +++ b/maven-core/src/main/java/org/apache/maven/plugin/DefaultPluginManager.java @@ -28,6 +28,7 @@ import org.apache.maven.artifact.resolver.filter.ArtifactFilter; import org.apache.maven.artifact.resolver.filter.ExclusionSetFilter; import org.apache.maven.execution.MavenSession; import org.apache.maven.lifecycle.GoalExecutionException; +import org.apache.maven.model.Goal; import org.apache.maven.model.Repository; import org.apache.maven.monitor.event.EventDispatcher; import org.apache.maven.monitor.event.MavenEvents; @@ -545,7 +546,25 @@ public class DefaultPluginManager // TODO: groupID not handled if ( pluginId.equals( plugin.getArtifactId() ) ) { - return CollectionUtils.mergeMaps( plugin.getConfiguration(), map ); + map = CollectionUtils.mergeMaps( plugin.getConfiguration(), map ); + + // TODO: much less of this magic is needed - make the mojoDescriptor just store the first and second part + int index = goalId.indexOf( ':' ); + if ( index >= 0 ) + { + String goalName = goalId.substring( index + 1 ); + for ( Iterator j = plugin.getGoals().iterator(); j.hasNext(); ) + { + Goal goal = (Goal) j.next(); + if ( goal.getId().equals( goalName ) ) + { + map = CollectionUtils.mergeMaps( goal.getConfiguration(), map ); + break; + } + } + } + + return map; } } }