mirror of https://github.com/apache/maven.git
PR: MNG-517
improve error reporting on invalid lifecycle goals git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@290899 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
a2c8a904cc
commit
12a5cf7169
|
@ -684,6 +684,23 @@ public class DefaultLifecycleExecutor
|
|||
{
|
||||
String goal = (String) k.next();
|
||||
MojoDescriptor desc = mojoDescriptor.getPluginDescriptor().getMojo( goal );
|
||||
|
||||
if ( desc == null )
|
||||
{
|
||||
String message = "Required goal '" + goal + "' not found in plugin '" +
|
||||
mojoDescriptor.getPluginDescriptor().getGoalPrefix() + "'";
|
||||
int index = goal.indexOf( ':' );
|
||||
if ( index >= 0 )
|
||||
{
|
||||
String prefix = goal.substring( index + 1 );
|
||||
if ( prefix.equals( mojoDescriptor.getPluginDescriptor().getGoalPrefix() ) )
|
||||
{
|
||||
message = message + " (goals should not be prefixed - try '" + prefix + "')";
|
||||
}
|
||||
}
|
||||
throw new LifecycleExecutionException( message );
|
||||
}
|
||||
|
||||
MojoExecution mojoExecution = new MojoExecution( desc, (Xpp3Dom) e.getConfiguration() );
|
||||
addToLifecycleMappings( lifecycleMappings, phase.getId(), mojoExecution,
|
||||
session.getSettings() );
|
||||
|
|
Loading…
Reference in New Issue