From 90c3f69e1c1a018600e34a6390bc49603336bebf Mon Sep 17 00:00:00 2001 From: John Dennis Casey Date: Wed, 22 Sep 2004 00:23:35 +0000 Subject: [PATCH] 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 --- .../goal/MavenGoalExecutionContext.java | 21 ++----------------- .../session/phase/GoalExecutionPhase.java | 4 ++-- .../java/org/apache/maven/MavenTestCase.java | 13 +----------- 3 files changed, 5 insertions(+), 33 deletions(-) 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; }