PR: MNG-608

diagnose place this change needs to occur

git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@226544 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Brett Leslie Porter 2005-07-30 16:26:02 +00:00
parent d978e51dc6
commit 13c5bc0df8
1 changed files with 11 additions and 6 deletions

View File

@ -273,7 +273,8 @@ private List segmentTaskListByAggregationNeeds( List tasks, MavenSession session
MojoDescriptor mojo = null;
try
{
mojo = getMojoDescriptor( task, session, project );
// definitely a CLI goal, can use prefix
mojo = getMojoDescriptor( task, session, project, true );
}
catch ( LifecycleExecutionException e )
{
@ -353,7 +354,8 @@ private void executeGoalWithLifecycle( String task, MavenSession session, Map li
private void executeStandaloneGoal( String task, MavenSession session, MavenProject project )
throws ArtifactResolutionException, LifecycleExecutionException, MojoExecutionException
{
MojoDescriptor mojoDescriptor = getMojoDescriptor( task, session, project );
// guaranteed to come from the CLI and not be part of a phase
MojoDescriptor mojoDescriptor = getMojoDescriptor( task, session, project, true );
executeGoals( Collections.singletonList( new MojoExecution( mojoDescriptor ) ), session, project );
}
@ -472,7 +474,9 @@ private Map bindLifecycleForPackaging( MavenSession session, String selectedPhas
{
String goal = tok.nextToken().trim();
MojoDescriptor mojoDescriptor = getMojoDescriptor( goal, session, project );
// Not from the CLI, don't use prefix
// TODO: [MNG-608] this needs to be false
MojoDescriptor mojoDescriptor = getMojoDescriptor( goal, session, project, true );
addToLifecycleMappings( lifecycleMappings, phase, new MojoExecution( mojoDescriptor ),
session.getSettings() );
}
@ -752,7 +756,8 @@ private List processGoalChain( String task, Map phaseMap )
return goals;
}
private MojoDescriptor getMojoDescriptor( String task, MavenSession session, MavenProject project )
private MojoDescriptor getMojoDescriptor( String task, MavenSession session, MavenProject project,
boolean canUsePrefixes )
throws ArtifactResolutionException, LifecycleExecutionException
{
String goal;
@ -762,7 +767,7 @@ private MojoDescriptor getMojoDescriptor( String task, MavenSession session, Mav
StringTokenizer tok = new StringTokenizer( task, ":" );
int numTokens = tok.countTokens();
if ( numTokens == 2 )
if ( numTokens == 2 && canUsePrefixes )
{
String prefix = tok.nextToken();
goal = tok.nextToken();
@ -895,7 +900,7 @@ protected void line()
private static class TaskSegment
{
private boolean aggregate = false;
private boolean aggregate;
private List tasks = new ArrayList();