Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
2.0.5
-
None
Description
The getMojo method fails with NPE because getMojos() method returns null. This happens when there's no mojo in the plugin.
The code should be modified to check for this situation, like this:
public MojoDescriptor getMojo( String goal )
{
List mojos = getMojos();
if(mojos==null) return null; // no mojo in this POM
MojoDescriptor mojoDescriptor = null;
for ( Iterator i = mojos.iterator(); i.hasNext() && mojoDescriptor == null; )
{
MojoDescriptor desc = (MojoDescriptor) i.next();
if ( goal.equals( desc.getGoal() ) )
}
return mojoDescriptor;
}