Check if plugin contains some mojo, and send an exception instead of NullPointerException if it isn't the case.

git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@179369 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Emmanuel Venisse 2005-06-01 09:08:04 +00:00
parent 4c582afdbf
commit 7bba85198e
1 changed files with 15 additions and 5 deletions

View File

@ -417,6 +417,8 @@ public class DefaultLifecycleExecutor
MojoDescriptor mojoDescriptor = null;
if ( pluginDescriptor.getMojos() != null )
{
// TODO: should be able to create a Map from this
for ( Iterator i = pluginDescriptor.getMojos().iterator(); i.hasNext() && mojoDescriptor == null; )
{
@ -426,6 +428,14 @@ public class DefaultLifecycleExecutor
mojoDescriptor = desc;
}
}
}
else
{
throw new LifecycleExecutionException( "The plugin " + pluginDescriptor.getGroupId() + ":" +
pluginDescriptor.getArtifactId() + ":" +
pluginDescriptor.getVersion() +
" doesn't contain any mojo. Check if it isn't corrupted." );
}
if ( mojoDescriptor == null )
{