diff --git a/maven-core/src/main/java/org/apache/maven/lifecycle/goal/MavenGoalExecutionContext.java b/maven-core/src/main/java/org/apache/maven/lifecycle/goal/MavenGoalExecutionContext.java index fabe74b742..4cb0e4d002 100644 --- a/maven-core/src/main/java/org/apache/maven/lifecycle/goal/MavenGoalExecutionContext.java +++ b/maven-core/src/main/java/org/apache/maven/lifecycle/goal/MavenGoalExecutionContext.java @@ -23,19 +23,17 @@ public class MavenGoalExecutionContext private FailureResponse failureResponse; - private MojoDescriptor mojoDescriptor; - private List resolvedGoals; // private GoalDecoratorBindings goalDecoratorBindings; private String goalName; - public MavenGoalExecutionContext( MavenSession session, MojoDescriptor goal ) + public MavenGoalExecutionContext( MavenSession session, String goalName ) { this.session = session; - this.mojoDescriptor = goal; + this.goalName = goalName; } 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() { return resolvedGoals; diff --git a/maven-core/src/main/java/org/apache/maven/lifecycle/session/phase/GoalExecutionPhase.java b/maven-core/src/main/java/org/apache/maven/lifecycle/session/phase/GoalExecutionPhase.java index 132d48454e..c041567d56 100644 --- a/maven-core/src/main/java/org/apache/maven/lifecycle/session/phase/GoalExecutionPhase.java +++ b/maven-core/src/main/java/org/apache/maven/lifecycle/session/phase/GoalExecutionPhase.java @@ -43,7 +43,7 @@ public class GoalExecutionPhase MavenGoalExecutionContext context; - context = new MavenGoalExecutionContext( session, session.getPluginManager().getMojoDescriptor( goal ) ); + context = new MavenGoalExecutionContext( session, goal ); context.setGoalName( goal ); @@ -51,7 +51,7 @@ public class GoalExecutionPhase if ( context.isExecutionFailure() ) { - response.setExecutionFailure( context.getMojoDescriptor().getId(), context.getFailureResponse() ); + response.setExecutionFailure( context.getGoalName(), context.getFailureResponse() ); break; } diff --git a/maven-core/src/test/java/org/apache/maven/MavenTestCase.java b/maven-core/src/test/java/org/apache/maven/MavenTestCase.java index 156236847a..eba2d1af51 100644 --- a/maven-core/src/test/java/org/apache/maven/MavenTestCase.java +++ b/maven-core/src/test/java/org/apache/maven/MavenTestCase.java @@ -126,18 +126,7 @@ public class MavenTestCase pluginManager.setLocalRepository( localRepository ); - MojoDescriptor descriptor; - - if ( goal != null ) - { - descriptor = pluginManager.getMojoDescriptor( goal ); - } - else - { - descriptor = new MojoDescriptor(); - } - - MavenGoalExecutionContext context = new MavenGoalExecutionContext( session, descriptor ); + MavenGoalExecutionContext context = new MavenGoalExecutionContext( session, goal ); return context; }