mirror of
https://github.com/apache/maven.git
synced 2025-02-13 05:26:25 +00:00
[MNG-7353] Add support for "mvn pluginPrefix:version:goal"
This closes #757
This commit is contained in:
parent
e1e4f5bda0
commit
95bdbf6821
@ -96,7 +96,7 @@ public List<TaskSegment> calculateTaskSegments( MavenSession session, List<Strin
|
|||||||
{
|
{
|
||||||
if ( isGoalSpecification( task ) )
|
if ( isGoalSpecification( task ) )
|
||||||
{
|
{
|
||||||
// "pluginPrefix:goal" or "groupId:artifactId[:version]:goal"
|
// "pluginPrefix[:version]:goal" or "groupId:artifactId[:version]:goal"
|
||||||
|
|
||||||
lifecyclePluginResolver.resolveMissingPluginVersions( session.getTopLevelProject(), session );
|
lifecyclePluginResolver.resolveMissingPluginVersions( session.getTopLevelProject(), session );
|
||||||
|
|
||||||
|
@ -176,18 +176,31 @@ public MojoDescriptor getMojoDescriptor( String task, MavenSession session, Mave
|
|||||||
}
|
}
|
||||||
else if ( numTokens == 3 )
|
else if ( numTokens == 3 )
|
||||||
{
|
{
|
||||||
// We have everything that we need except the version
|
// groupId:artifactId:goal or pluginPrefix:version:goal (since Maven 3.9.0)
|
||||||
//
|
|
||||||
// org.apache.maven.plugins:maven-remote-resources-plugin:???:process
|
String firstToken = tok.nextToken();
|
||||||
//
|
// groupId or pluginPrefix? heuristics: groupId contains dot (.) but not pluginPrefix
|
||||||
// groupId
|
if ( firstToken.contains( "." ) )
|
||||||
// artifactId
|
{
|
||||||
// ???
|
// We have everything that we need except the version
|
||||||
// goal
|
//
|
||||||
//
|
// org.apache.maven.plugins:maven-remote-resources-plugin:???:process
|
||||||
plugin = new Plugin();
|
//
|
||||||
plugin.setGroupId( tok.nextToken() );
|
// groupId
|
||||||
plugin.setArtifactId( tok.nextToken() );
|
// artifactId
|
||||||
|
// ???
|
||||||
|
// goal
|
||||||
|
//
|
||||||
|
plugin = new Plugin();
|
||||||
|
plugin.setGroupId( firstToken );
|
||||||
|
plugin.setArtifactId( tok.nextToken() );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// pluginPrefix:version:goal, like remote-resources:3.5.0:process
|
||||||
|
plugin = findPluginForPrefix( firstToken, session );
|
||||||
|
plugin.setVersion( tok.nextToken() );
|
||||||
|
}
|
||||||
goal = tok.nextToken();
|
goal = tok.nextToken();
|
||||||
}
|
}
|
||||||
else if ( numTokens <= 2 )
|
else if ( numTokens <= 2 )
|
||||||
|
Loading…
x
Reference in New Issue
Block a user