mirror of https://github.com/apache/maven.git
Resolving: MNG-608 (deprecate for now, remove later...notes in TODOs)
git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@231084 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
ec2da14433
commit
0f9196a83d
|
@ -365,7 +365,7 @@ public class DefaultLifecycleExecutor
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
// definitely a CLI goal, can use prefix
|
// definitely a CLI goal, can use prefix
|
||||||
mojo = getMojoDescriptor( task, session, project, true );
|
mojo = getMojoDescriptor( task, session, project, task, true );
|
||||||
}
|
}
|
||||||
catch ( LifecycleExecutionException e )
|
catch ( LifecycleExecutionException e )
|
||||||
{
|
{
|
||||||
|
@ -449,7 +449,7 @@ public class DefaultLifecycleExecutor
|
||||||
throws ArtifactResolutionException, LifecycleExecutionException, MojoExecutionException
|
throws ArtifactResolutionException, LifecycleExecutionException, MojoExecutionException
|
||||||
{
|
{
|
||||||
// guaranteed to come from the CLI and not be part of a phase
|
// guaranteed to come from the CLI and not be part of a phase
|
||||||
MojoDescriptor mojoDescriptor = getMojoDescriptor( task, session, project, true );
|
MojoDescriptor mojoDescriptor = getMojoDescriptor( task, session, project, task, true );
|
||||||
executeGoals( Collections.singletonList( new MojoExecution( mojoDescriptor ) ), session, project );
|
executeGoals( Collections.singletonList( new MojoExecution( mojoDescriptor ) ), session, project );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -570,7 +570,7 @@ public class DefaultLifecycleExecutor
|
||||||
|
|
||||||
// Not from the CLI, don't use prefix
|
// Not from the CLI, don't use prefix
|
||||||
// TODO: [MNG-608] this needs to be false
|
// TODO: [MNG-608] this needs to be false
|
||||||
MojoDescriptor mojoDescriptor = getMojoDescriptor( goal, session, project, true );
|
MojoDescriptor mojoDescriptor = getMojoDescriptor( goal, session, project, selectedPhase, false );
|
||||||
addToLifecycleMappings( lifecycleMappings, phase, new MojoExecution( mojoDescriptor ),
|
addToLifecycleMappings( lifecycleMappings, phase, new MojoExecution( mojoDescriptor ),
|
||||||
session.getSettings() );
|
session.getSettings() );
|
||||||
}
|
}
|
||||||
|
@ -851,7 +851,7 @@ public class DefaultLifecycleExecutor
|
||||||
}
|
}
|
||||||
|
|
||||||
private MojoDescriptor getMojoDescriptor( String task, MavenSession session, MavenProject project,
|
private MojoDescriptor getMojoDescriptor( String task, MavenSession session, MavenProject project,
|
||||||
boolean canUsePrefixes )
|
String invokedVia, boolean canUsePrefix )
|
||||||
throws ArtifactResolutionException, LifecycleExecutionException
|
throws ArtifactResolutionException, LifecycleExecutionException
|
||||||
{
|
{
|
||||||
String goal;
|
String goal;
|
||||||
|
@ -861,8 +861,15 @@ public class DefaultLifecycleExecutor
|
||||||
|
|
||||||
StringTokenizer tok = new StringTokenizer( task, ":" );
|
StringTokenizer tok = new StringTokenizer( task, ":" );
|
||||||
int numTokens = tok.countTokens();
|
int numTokens = tok.countTokens();
|
||||||
if ( numTokens == 2 && canUsePrefixes )
|
|
||||||
|
// TODO: Add "&& canUsePrefix" to this boolean expression, and remove deprecation warning in next release.
|
||||||
|
if ( numTokens == 2 )
|
||||||
{
|
{
|
||||||
|
if ( !canUsePrefix )
|
||||||
|
{
|
||||||
|
getLogger().warn( "DEPRECATED: Mapped-prefix lookup of mojos are only supported from direct invocation. Please use specification of the form groupId:artifactId[:version]:goal instead. (Offending mojo: \'" + task + "\', invoked via: \'" + invokedVia + "\')" );
|
||||||
|
}
|
||||||
|
|
||||||
String prefix = tok.nextToken();
|
String prefix = tok.nextToken();
|
||||||
goal = tok.nextToken();
|
goal = tok.nextToken();
|
||||||
|
|
||||||
|
@ -919,13 +926,17 @@ public class DefaultLifecycleExecutor
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if ( numTokens == 4 )
|
else if ( numTokens == 3 || numTokens == 4 )
|
||||||
{
|
{
|
||||||
plugin = new Plugin();
|
plugin = new Plugin();
|
||||||
|
|
||||||
plugin.setGroupId( tok.nextToken() );
|
plugin.setGroupId( tok.nextToken() );
|
||||||
plugin.setArtifactId( tok.nextToken() );
|
plugin.setArtifactId( tok.nextToken() );
|
||||||
plugin.setVersion( tok.nextToken() );
|
|
||||||
|
if ( numTokens == 4 )
|
||||||
|
{
|
||||||
|
plugin.setVersion( tok.nextToken() );
|
||||||
|
}
|
||||||
|
|
||||||
goal = tok.nextToken();
|
goal = tok.nextToken();
|
||||||
}
|
}
|
||||||
|
|
|
@ -162,14 +162,17 @@
|
||||||
<!-- END SNIPPET: lifecycle -->
|
<!-- END SNIPPET: lifecycle -->
|
||||||
<!-- START SNIPPET: default-lifecycle -->
|
<!-- START SNIPPET: default-lifecycle -->
|
||||||
<defaultPhases>
|
<defaultPhases>
|
||||||
<process-resources>resources:resources</process-resources>
|
<process-resources>org.apache.maven.plugins:maven-resources-plugin:resources</process-resources>
|
||||||
<compile>compiler:compile</compile>
|
<compile>org.apache.maven.plugins:maven-compiler-plugin:compile</compile>
|
||||||
<process-test-resources>resources:testResources</process-test-resources>
|
<process-test-resources>org.apache.maven.plugins:maven-resources-plugin:testResources</process-test-resources>
|
||||||
<test-compile>compiler:testCompile</test-compile>
|
<test-compile>org.apache.maven.plugins:maven-compiler-plugin:testCompile</test-compile>
|
||||||
<test>surefire:test</test>
|
<test>org.apache.maven.plugins:maven-surefire-plugin:test</test>
|
||||||
<package>jar:jar,source:jar</package>
|
<package>
|
||||||
<install>install:install</install>
|
org.apache.maven.plugins:maven-jar-plugin:jar,
|
||||||
<deploy>deploy:deploy</deploy>
|
org.apache.maven.plugins:maven-source-plugin:jar
|
||||||
|
</package>
|
||||||
|
<install>org.apache.maven.plugins:maven-install-plugin:install</install>
|
||||||
|
<deploy>org.apache.maven.plugins:maven-deploy-plugin:deploy</deploy>
|
||||||
</defaultPhases>
|
</defaultPhases>
|
||||||
<!-- END SNIPPET: default-lifecycle -->
|
<!-- END SNIPPET: default-lifecycle -->
|
||||||
</configuration>
|
</configuration>
|
||||||
|
@ -185,8 +188,8 @@
|
||||||
<configuration>
|
<configuration>
|
||||||
<!-- START SNIPPET: pom-lifecycle -->
|
<!-- START SNIPPET: pom-lifecycle -->
|
||||||
<phases>
|
<phases>
|
||||||
<install>install:install</install>
|
<install>org.apache.maven.plugins:maven-install-plugin:install</install>
|
||||||
<deploy>deploy:deploy</deploy>
|
<deploy>org.apache.maven.plugins:maven-deploy-plugin:deploy</deploy>
|
||||||
</phases>
|
</phases>
|
||||||
<!-- END SNIPPET: pom-lifecycle -->
|
<!-- END SNIPPET: pom-lifecycle -->
|
||||||
</configuration>
|
</configuration>
|
||||||
|
@ -199,14 +202,17 @@
|
||||||
<configuration>
|
<configuration>
|
||||||
<!-- START SNIPPET: jar-lifecycle -->
|
<!-- START SNIPPET: jar-lifecycle -->
|
||||||
<phases>
|
<phases>
|
||||||
<process-resources>resources:resources</process-resources>
|
<process-resources>org.apache.maven.plugins:maven-resources-plugin:resources</process-resources>
|
||||||
<compile>compiler:compile</compile>
|
<compile>org.apache.maven.plugins:maven-compiler-plugin:compile</compile>
|
||||||
<process-test-resources>resources:testResources</process-test-resources>
|
<process-test-resources>org.apache.maven.plugins:maven-resources-plugin:testResources</process-test-resources>
|
||||||
<test-compile>compiler:testCompile</test-compile>
|
<test-compile>org.apache.maven.plugins:maven-compiler-plugin:testCompile</test-compile>
|
||||||
<test>surefire:test</test>
|
<test>org.apache.maven.plugins:maven-surefire-plugin:test</test>
|
||||||
<package>jar:jar,source:jar</package>
|
<package>
|
||||||
<install>install:install</install>
|
org.apache.maven.plugins:maven-jar-plugin:jar,
|
||||||
<deploy>deploy:deploy</deploy>
|
org.apache.maven.plugins:maven-source-plugin:jar
|
||||||
|
</package>
|
||||||
|
<install>org.apache.maven.plugins:maven-install-plugin:install</install>
|
||||||
|
<deploy>org.apache.maven.plugins:maven-deploy-plugin:deploy</deploy>
|
||||||
</phases>
|
</phases>
|
||||||
<!-- END SNIPPET: jar-lifecycle -->
|
<!-- END SNIPPET: jar-lifecycle -->
|
||||||
</configuration>
|
</configuration>
|
||||||
|
@ -219,15 +225,24 @@
|
||||||
<configuration>
|
<configuration>
|
||||||
<!-- START SNIPPET: maven-plugin-lifecycle -->
|
<!-- START SNIPPET: maven-plugin-lifecycle -->
|
||||||
<phases>
|
<phases>
|
||||||
<generate-resources>plugin:descriptor</generate-resources>
|
<generate-resources>org.apache.maven.plugins:maven-plugin-plugin:descriptor</generate-resources>
|
||||||
<process-resources>resources:resources</process-resources>
|
<process-resources>org.apache.maven.plugins:maven-resources-plugin:resources</process-resources>
|
||||||
<compile>compiler:compile</compile>
|
<compile>org.apache.maven.plugins:maven-compiler-plugin:compile</compile>
|
||||||
<process-test-resources>resources:testResources</process-test-resources>
|
<process-test-resources>org.apache.maven.plugins:maven-resources-plugin:testResources</process-test-resources>
|
||||||
<test-compile>compiler:testCompile</test-compile>
|
<test-compile>org.apache.maven.plugins:maven-compiler-plugin:testCompile</test-compile>
|
||||||
<test>surefire:test</test>
|
<test>org.apache.maven.plugins:maven-surefire-plugin:test</test>
|
||||||
<package>jar:jar,plugin:addPluginArtifactMetadata</package>
|
<package>
|
||||||
<install>install:install,plugin:installMapping</install>
|
org.apache.maven.plugins:maven-jar-plugin:jar,
|
||||||
<deploy>deploy:deploy,plugin:deployMapping</deploy>
|
org.apache.maven.plugins:maven-plugin-plugin:addPluginArtifactMetadata
|
||||||
|
</package>
|
||||||
|
<install>
|
||||||
|
org.apache.maven.plugins:maven-install-plugin:install,
|
||||||
|
org.apache.maven.plugins:maven-plugin-plugin:installMapping
|
||||||
|
</install>
|
||||||
|
<deploy>
|
||||||
|
org.apache.maven.plugins:maven-deploy-plugin:deploy,
|
||||||
|
org.apache.maven.plugins:maven-plugin-plugin:deployMapping
|
||||||
|
</deploy>
|
||||||
</phases>
|
</phases>
|
||||||
<!-- END SNIPPET: maven-plugin-lifecycle -->
|
<!-- END SNIPPET: maven-plugin-lifecycle -->
|
||||||
</configuration>
|
</configuration>
|
||||||
|
@ -240,14 +255,17 @@
|
||||||
<configuration>
|
<configuration>
|
||||||
<!-- START SNIPPET: ejb-lifecycle -->
|
<!-- START SNIPPET: ejb-lifecycle -->
|
||||||
<phases>
|
<phases>
|
||||||
<process-resources>resources:resources</process-resources>
|
<process-resources>org.apache.maven.plugins:maven-resources-plugin:resources</process-resources>
|
||||||
<compile>compiler:compile</compile>
|
<compile>org.apache.maven.plugins:maven-compiler-plugin:compile</compile>
|
||||||
<process-test-resources>resources:testResources</process-test-resources>
|
<process-test-resources>org.apache.maven.plugins:maven-resources-plugin:testResources</process-test-resources>
|
||||||
<test-compile>compiler:testCompile</test-compile>
|
<test-compile>org.apache.maven.plugins:maven-compiler-plugin:testCompile</test-compile>
|
||||||
<test>surefire:test</test>
|
<test>org.apache.maven.plugins:maven-surefire-plugin:test</test>
|
||||||
<package>ejb:ejb,source:jar</package>
|
<package>
|
||||||
<install>install:install</install>
|
org.apache.maven.plugins:maven-ejb-plugin:ejb,
|
||||||
<deploy>deploy:deploy</deploy>
|
org.apache.maven.plugins:maven-source-plugin:jar
|
||||||
|
</package>
|
||||||
|
<install>org.apache.maven.plugins:maven-install-plugin:install</install>
|
||||||
|
<deploy>org.apache.maven.plugins:maven-deploy-plugin:deploy</deploy>
|
||||||
</phases>
|
</phases>
|
||||||
<!-- END SNIPPET: ejb-lifecycle -->
|
<!-- END SNIPPET: ejb-lifecycle -->
|
||||||
</configuration>
|
</configuration>
|
||||||
|
@ -260,14 +278,14 @@
|
||||||
<configuration>
|
<configuration>
|
||||||
<!-- START SNIPPET: war-lifecycle -->
|
<!-- START SNIPPET: war-lifecycle -->
|
||||||
<phases>
|
<phases>
|
||||||
<process-resources>resources:resources</process-resources>
|
<process-resources>org.apache.maven.plugins:maven-resources-plugin:resources</process-resources>
|
||||||
<compile>compiler:compile</compile>
|
<compile>org.apache.maven.plugins:maven-compiler-plugin:compile</compile>
|
||||||
<process-test-resources>resources:testResources</process-test-resources>
|
<process-test-resources>org.apache.maven.plugins:maven-resources-plugin:testResources</process-test-resources>
|
||||||
<test-compile>compiler:testCompile</test-compile>
|
<test-compile>org.apache.maven.plugins:maven-compiler-plugin:testCompile</test-compile>
|
||||||
<test>surefire:test</test>
|
<test>org.apache.maven.plugins:maven-surefire-plugin:test</test>
|
||||||
<package>war:war</package>
|
<package>org.apache.maven.plugins:maven-war-plugin:war</package>
|
||||||
<install>install:install</install>
|
<install>org.apache.maven.plugins:maven-install-plugin:install</install>
|
||||||
<deploy>deploy:deploy</deploy>
|
<deploy>org.apache.maven.plugins:maven-deploy-plugin:deploy</deploy>
|
||||||
</phases>
|
</phases>
|
||||||
<!-- END SNIPPET: war-lifecycle -->
|
<!-- END SNIPPET: war-lifecycle -->
|
||||||
</configuration>
|
</configuration>
|
||||||
|
@ -280,10 +298,10 @@
|
||||||
<configuration>
|
<configuration>
|
||||||
<!-- START SNIPPET: ear-lifecycle -->
|
<!-- START SNIPPET: ear-lifecycle -->
|
||||||
<phases>
|
<phases>
|
||||||
<generate-resources>ear:generate-application-xml</generate-resources>
|
<generate-resources>org.apache.maven.plugins:maven-ear-plugin:generate-application-xml</generate-resources>
|
||||||
<package>ear:ear</package>
|
<package>org.apache.maven.plugins:maven-ear-plugin:ear</package>
|
||||||
<install>install:install</install>
|
<install>org.apache.maven.plugins:maven-install-plugin:install</install>
|
||||||
<deploy>deploy:deploy</deploy>
|
<deploy>org.apache.maven.plugins:maven-deploy-plugin:deploy</deploy>
|
||||||
</phases>
|
</phases>
|
||||||
<!-- END SNIPPET: ear-lifecycle -->
|
<!-- END SNIPPET: ear-lifecycle -->
|
||||||
</configuration>
|
</configuration>
|
||||||
|
|
Loading…
Reference in New Issue