mirror of https://github.com/apache/maven.git
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:
parent
4c582afdbf
commit
7bba85198e
|
@ -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 )
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue