mirror of https://github.com/apache/maven.git
o removed the current mojo descriptor stuff from the goal execution context...doesn't seem to be used anywhere, and it'll cause problems if the current goal is from a plugin that has not been resolved yet.
git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@163135 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
717f716b4f
commit
90c3f69e1c
|
@ -23,19 +23,17 @@ public class MavenGoalExecutionContext
|
||||||
|
|
||||||
private FailureResponse failureResponse;
|
private FailureResponse failureResponse;
|
||||||
|
|
||||||
private MojoDescriptor mojoDescriptor;
|
|
||||||
|
|
||||||
private List resolvedGoals;
|
private List resolvedGoals;
|
||||||
|
|
||||||
// private GoalDecoratorBindings goalDecoratorBindings;
|
// private GoalDecoratorBindings goalDecoratorBindings;
|
||||||
|
|
||||||
private String goalName;
|
private String goalName;
|
||||||
|
|
||||||
public MavenGoalExecutionContext( MavenSession session, MojoDescriptor goal )
|
public MavenGoalExecutionContext( MavenSession session, String goalName )
|
||||||
{
|
{
|
||||||
this.session = session;
|
this.session = session;
|
||||||
|
|
||||||
this.mojoDescriptor = goal;
|
this.goalName = goalName;
|
||||||
}
|
}
|
||||||
|
|
||||||
public MavenSession getSession()
|
public MavenSession getSession()
|
||||||
|
@ -79,21 +77,6 @@ public class MavenGoalExecutionContext
|
||||||
|
|
||||||
// ----------------------------------------------------------------------
|
// ----------------------------------------------------------------------
|
||||||
|
|
||||||
public boolean requiresDependencyResolution()
|
|
||||||
{
|
|
||||||
return mojoDescriptor.requiresDependencyResolution();
|
|
||||||
}
|
|
||||||
|
|
||||||
public MojoDescriptor getMojoDescriptor()
|
|
||||||
{
|
|
||||||
return mojoDescriptor;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setMojoDescriptor( MojoDescriptor mojoDescriptor )
|
|
||||||
{
|
|
||||||
this.mojoDescriptor = mojoDescriptor;
|
|
||||||
}
|
|
||||||
|
|
||||||
public List getResolvedGoals()
|
public List getResolvedGoals()
|
||||||
{
|
{
|
||||||
return resolvedGoals;
|
return resolvedGoals;
|
||||||
|
|
|
@ -43,7 +43,7 @@ public class GoalExecutionPhase
|
||||||
|
|
||||||
MavenGoalExecutionContext context;
|
MavenGoalExecutionContext context;
|
||||||
|
|
||||||
context = new MavenGoalExecutionContext( session, session.getPluginManager().getMojoDescriptor( goal ) );
|
context = new MavenGoalExecutionContext( session, goal );
|
||||||
|
|
||||||
context.setGoalName( goal );
|
context.setGoalName( goal );
|
||||||
|
|
||||||
|
@ -51,7 +51,7 @@ public class GoalExecutionPhase
|
||||||
|
|
||||||
if ( context.isExecutionFailure() )
|
if ( context.isExecutionFailure() )
|
||||||
{
|
{
|
||||||
response.setExecutionFailure( context.getMojoDescriptor().getId(), context.getFailureResponse() );
|
response.setExecutionFailure( context.getGoalName(), context.getFailureResponse() );
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -126,18 +126,7 @@ public class MavenTestCase
|
||||||
|
|
||||||
pluginManager.setLocalRepository( localRepository );
|
pluginManager.setLocalRepository( localRepository );
|
||||||
|
|
||||||
MojoDescriptor descriptor;
|
MavenGoalExecutionContext context = new MavenGoalExecutionContext( session, goal );
|
||||||
|
|
||||||
if ( goal != null )
|
|
||||||
{
|
|
||||||
descriptor = pluginManager.getMojoDescriptor( goal );
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
descriptor = new MojoDescriptor();
|
|
||||||
}
|
|
||||||
|
|
||||||
MavenGoalExecutionContext context = new MavenGoalExecutionContext( session, descriptor );
|
|
||||||
|
|
||||||
return context;
|
return context;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue