Repository: maven
Updated Branches:
  refs/heads/master cd52e5b51 -> ee7dbab69


MNG-5768 @execution-id syntax for direct plugin goal invocation

Signed-off-by: Igor Fedorenko <[email protected]>


Project: http://git-wip-us.apache.org/repos/asf/maven/repo
Commit: http://git-wip-us.apache.org/repos/asf/maven/commit/ee7dbab6
Tree: http://git-wip-us.apache.org/repos/asf/maven/tree/ee7dbab6
Diff: http://git-wip-us.apache.org/repos/asf/maven/diff/ee7dbab6

Branch: refs/heads/master
Commit: ee7dbab69dd87d219031b0715105527cdbf12639
Parents: cd52e5b
Author: Igor Fedorenko <[email protected]>
Authored: Fri Feb 20 07:58:31 2015 -0500
Committer: Igor Fedorenko <[email protected]>
Committed: Fri Feb 20 07:58:31 2015 -0500

----------------------------------------------------------------------
 .../internal/DefaultLifecycleExecutionPlanCalculator.java | 10 ++++++++--
 .../maven/lifecycle/internal/MojoDescriptorCreator.java   |  8 +++++++-
 2 files changed, 15 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/maven/blob/ee7dbab6/maven-core/src/main/java/org/apache/maven/lifecycle/internal/DefaultLifecycleExecutionPlanCalculator.java
----------------------------------------------------------------------
diff --git 
a/maven-core/src/main/java/org/apache/maven/lifecycle/internal/DefaultLifecycleExecutionPlanCalculator.java
 
b/maven-core/src/main/java/org/apache/maven/lifecycle/internal/DefaultLifecycleExecutionPlanCalculator.java
index a5db25f..0f060dc 100644
--- 
a/maven-core/src/main/java/org/apache/maven/lifecycle/internal/DefaultLifecycleExecutionPlanCalculator.java
+++ 
b/maven-core/src/main/java/org/apache/maven/lifecycle/internal/DefaultLifecycleExecutionPlanCalculator.java
@@ -195,10 +195,16 @@ public class DefaultLifecycleExecutionPlanCalculator
             {
                 String pluginGoal = ( (GoalTask) task ).pluginGoal;
 
+                String executionId = "default-cli";
+                int executionIdx = pluginGoal.indexOf( '@' );
+                if ( executionIdx > 0 )
+                {
+                    executionId = pluginGoal.substring( executionIdx + 1 );
+                }
+
                 MojoDescriptor mojoDescriptor = 
mojoDescriptorCreator.getMojoDescriptor( pluginGoal, session, project );
 
-                MojoExecution mojoExecution =
-                    new MojoExecution( mojoDescriptor, "default-cli", 
MojoExecution.Source.CLI );
+                MojoExecution mojoExecution = new MojoExecution( 
mojoDescriptor, executionId, MojoExecution.Source.CLI );
 
                 mojoExecutions.add( mojoExecution );
             }

http://git-wip-us.apache.org/repos/asf/maven/blob/ee7dbab6/maven-core/src/main/java/org/apache/maven/lifecycle/internal/MojoDescriptorCreator.java
----------------------------------------------------------------------
diff --git 
a/maven-core/src/main/java/org/apache/maven/lifecycle/internal/MojoDescriptorCreator.java
 
b/maven-core/src/main/java/org/apache/maven/lifecycle/internal/MojoDescriptorCreator.java
index da04b23..36c85fd 100644
--- 
a/maven-core/src/main/java/org/apache/maven/lifecycle/internal/MojoDescriptorCreator.java
+++ 
b/maven-core/src/main/java/org/apache/maven/lifecycle/internal/MojoDescriptorCreator.java
@@ -136,7 +136,7 @@ public class MojoDescriptorCreator
         return dom;
     }
 
-    // org.apache.maven.plugins:maven-remote-resources-plugin:1.0:process
+    // 
org.apache.maven.plugins:maven-remote-resources-plugin:1.0:process@executionId
 
     public MojoDescriptor getMojoDescriptor( String task, MavenSession 
session, MavenProject project )
         throws PluginNotFoundException, PluginResolutionException, 
PluginDescriptorParsingException,
@@ -220,6 +220,12 @@ public class MojoDescriptorCreator
             plugin = findPluginForPrefix( prefix, session );
         }
 
+        int executionIdx = goal.indexOf( '@' );
+        if ( executionIdx > 0 )
+        {
+            goal = goal.substring( 0, executionIdx );
+        }
+
         injectPluginDeclarationFromProject( plugin, project );
 
         // If there is no version to be found then we need to look in the 
repository metadata for

Reply via email to