o Added check for null MojoDescriptor in the lifecycle context (throws GoalNotFoundException if == null)

git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@162940 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
John Dennis Casey 2004-08-10 02:38:07 +00:00
parent 8b4d55e55d
commit 567a47cf82
1 changed files with 7 additions and 1 deletions

View File

@ -17,6 +17,7 @@ package org.apache.maven.lifecycle.phase;
* limitations under the License.
*/
import org.apache.maven.GoalNotFoundException;
import org.apache.maven.decoration.GoalDecorator;
import org.apache.maven.decoration.GoalDecoratorBindings;
import org.apache.maven.lifecycle.AbstractMavenLifecyclePhase;
@ -47,7 +48,12 @@ public class GoalResolutionPhase extends AbstractMavenLifecyclePhase
pluginManager = (PluginManager) context.getContainer().lookup( PluginManager.ROLE );
// First, start by retrieving the currently-requested goal.
String goal = context.getMojoDescriptor().getId();
MojoDescriptor goalDescriptor = context.getMojoDescriptor();
if(goalDescriptor == null) {
throw new GoalNotFoundException(context.getGoalName());
}
String goal = goalDescriptor.getId();
List resolvedGoals = resolveTopLevel( goal, new HashSet(), new LinkedList(), context, pluginManager );