From d0ca6d9490fec0a37b0bed79ca52c602b0f0020b Mon Sep 17 00:00:00 2001 From: Benjamin Bentmann Date: Wed, 22 Jul 2009 17:07:46 +0000 Subject: [PATCH] o Fixed parsing of lifecycle mappings to account for version git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@796797 13f79535-47bb-0310-9956-ffa450edef68 --- .../apache/maven/lifecycle/DefaultLifecycleExecutor.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/maven-core/src/main/java/org/apache/maven/lifecycle/DefaultLifecycleExecutor.java b/maven-core/src/main/java/org/apache/maven/lifecycle/DefaultLifecycleExecutor.java index e55c60139d..5a0cfd17f1 100644 --- a/maven-core/src/main/java/org/apache/maven/lifecycle/DefaultLifecycleExecutor.java +++ b/maven-core/src/main/java/org/apache/maven/lifecycle/DefaultLifecycleExecutor.java @@ -846,17 +846,22 @@ public class DefaultLifecycleExecutor { for ( StringTokenizer tok = new StringTokenizer( goals, "," ); tok.hasMoreTokens(); ) { + // either :: or ::: String goal = tok.nextToken().trim(); String[] p = StringUtils.split( goal, ":" ); PluginExecution execution = new PluginExecution(); - execution.setId( "default-" + p[2] ); + execution.setId( "default-" + p[p.length - 1] ); execution.setPhase( phase ); - execution.getGoals().add( p[2] ); + execution.getGoals().add( p[p.length - 1] ); Plugin plugin = new Plugin(); plugin.setGroupId( p[0] ); plugin.setArtifactId( p[1] ); + if ( p.length >= 4 ) + { + plugin.setVersion( p[2] ); + } Plugin existing = plugins.get( plugin ); if ( existing != null )