You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by be...@apache.org on 2009/07/22 19:07:46 UTC

svn commit: r796797 - /maven/components/trunk/maven-core/src/main/java/org/apache/maven/lifecycle/DefaultLifecycleExecutor.java

Author: bentmann
Date: Wed Jul 22 17:07:46 2009
New Revision: 796797

URL: http://svn.apache.org/viewvc?rev=796797&view=rev
Log:
o Fixed parsing of lifecycle mappings to account for version

Modified:
    maven/components/trunk/maven-core/src/main/java/org/apache/maven/lifecycle/DefaultLifecycleExecutor.java

Modified: maven/components/trunk/maven-core/src/main/java/org/apache/maven/lifecycle/DefaultLifecycleExecutor.java
URL: http://svn.apache.org/viewvc/maven/components/trunk/maven-core/src/main/java/org/apache/maven/lifecycle/DefaultLifecycleExecutor.java?rev=796797&r1=796796&r2=796797&view=diff
==============================================================================
--- maven/components/trunk/maven-core/src/main/java/org/apache/maven/lifecycle/DefaultLifecycleExecutor.java (original)
+++ maven/components/trunk/maven-core/src/main/java/org/apache/maven/lifecycle/DefaultLifecycleExecutor.java Wed Jul 22 17:07:46 2009
@@ -846,17 +846,22 @@
     {
         for ( StringTokenizer tok = new StringTokenizer( goals, "," ); tok.hasMoreTokens(); )
         {
+            // either <groupId>:<artifactId>:<goal> or <groupId>:<artifactId>:<version>:<goal>
             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 )