mirror of https://github.com/apache/maven.git
[MNG-7353] Add support for "mvn pluginPrefix:version:goal"
This closes #757
This commit is contained in:
parent
8125b3131f
commit
35b93b0a58
|
@ -102,7 +102,7 @@ public class DefaultLifecycleTaskSegmentCalculator
|
|||
{
|
||||
if ( isGoalSpecification( task ) )
|
||||
{
|
||||
// "pluginPrefix:goal" or "groupId:artifactId[:version]:goal"
|
||||
// "pluginPrefix[:version]:goal" or "groupId:artifactId[:version]:goal"
|
||||
|
||||
lifecyclePluginResolver.resolveMissingPluginVersions( session.getTopLevelProject(), session );
|
||||
|
||||
|
|
|
@ -169,18 +169,31 @@ public class MojoDescriptorCreator
|
|||
}
|
||||
else if ( numTokens == 3 )
|
||||
{
|
||||
// We have everything that we need except the version
|
||||
//
|
||||
// org.apache.maven.plugins:maven-remote-resources-plugin:???:process
|
||||
//
|
||||
// groupId
|
||||
// artifactId
|
||||
// ???
|
||||
// goal
|
||||
//
|
||||
plugin = new Plugin();
|
||||
plugin.setGroupId( tok.nextToken() );
|
||||
plugin.setArtifactId( tok.nextToken() );
|
||||
// groupId:artifactId:goal or pluginPrefix:version:goal (since Maven 3.9.0)
|
||||
|
||||
String firstToken = tok.nextToken();
|
||||
// groupId or pluginPrefix? heuristics: groupId contains dot (.) but not pluginPrefix
|
||||
if ( firstToken.contains( "." ) )
|
||||
{
|
||||
// We have everything that we need except the version
|
||||
//
|
||||
// org.apache.maven.plugins:maven-remote-resources-plugin:???:process
|
||||
//
|
||||
// groupId
|
||||
// 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();
|
||||
}
|
||||
else
|
||||
|
|
Loading…
Reference in New Issue