mirror of https://github.com/apache/maven.git
MNG-5768 @execution-id syntax for direct plugin goal invocation
Signed-off-by: Igor Fedorenko <ifedorenko@apache.org>
This commit is contained in:
parent
cd52e5b51e
commit
ee7dbab69d
|
@ -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 );
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue