Details
-
Bug
-
Status: Closed
-
Blocker
-
Resolution: Fixed
-
3.0
-
None
-
Patch
Description
I have this definition :
@Mojo( name = "aggregate-add-third-party", requiresProject = true, aggregator = true, defaultPhase = LifecyclePhase.GENERATE_RESOURCES ) @Execute( goal = "add-third-party" )
And this exeception then while building :
Caused by: java.lang.NullPointerException at org.apache.maven.tools.plugin.annotations.JavaAnnotationsMojoDescriptorExtractor.toMojoDescriptors(JavaAnnotationsMojoDescriptorExtractor.java:522) at org.apache.maven.tools.plugin.annotations.JavaAnnotationsMojoDescriptorExtractor.execute(JavaAnnotationsMojoDescriptorExtractor.java:110) at org.apache.maven.tools.plugin.scanner.DefaultMojoScanner.populatePluginDescriptor(DefaultMojoScanner.java:108) at org.apache.maven.plugin.plugin.AbstractGeneratorMojo.execute(AbstractGeneratorMojo.java:245) at org.apache.maven.plugin.plugin.HelpGeneratorMojo.execute(HelpGeneratorMojo.java:88) at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101) ... 20 more
I had a look to the code and it is normal (I think)
if ( execute != null ) { mojoDescriptor.setExecuteGoal( execute.goal() ); mojoDescriptor.setExecuteLifecycle( execute.lifecycle() ); mojoDescriptor.setExecutePhase( execute.phase().id() ); }
but should be
if ( execute != null ) { mojoDescriptor.setExecuteGoal( execute.goal() ); mojoDescriptor.setExecuteLifecycle( execute.lifecycle() ); if ( execute.phase() != null ) { mojoDescriptor.setExecutePhase( execute.phase().id() ); } }