diff --git a/maven-plugin-tools-generators/src/main/java/org/apache/maven/tools/plugin/generator/PluginHelpGenerator.java b/maven-plugin-tools-generators/src/main/java/org/apache/maven/tools/plugin/generator/PluginHelpGenerator.java index a153d14..045c058 100644 --- a/maven-plugin-tools-generators/src/main/java/org/apache/maven/tools/plugin/generator/PluginHelpGenerator.java +++ b/maven-plugin-tools-generators/src/main/java/org/apache/maven/tools/plugin/generator/PluginHelpGenerator.java @@ -107,20 +107,18 @@ public class PluginHelpGenerator if ( mojoDescriptors != null ) { // Verify that no help goal already exists - for ( MojoDescriptor descriptor : mojoDescriptors ) - { - if ( HELP_GOAL.equals( descriptor.getGoal() ) - && !descriptor.getImplementation().equals( helpImplementation ) ) - { - if ( getLogger().isWarnEnabled() ) - { - getLogger().warn( "\n\nA help goal (" + descriptor.getImplementation() - + ") already exists in this plugin. SKIPPED THE " - + helpImplementation + " GENERATION.\n" ); - } + MojoDescriptor descriptor = pluginDescriptor.getMojo( HELP_GOAL ); - return; + if ( ( descriptor != null ) && !descriptor.getImplementation().equals( helpImplementation ) ) + { + if ( getLogger().isWarnEnabled() ) + { + getLogger().warn( "\n\nA help goal (" + descriptor.getImplementation() + + ") already exists in this plugin. SKIPPED THE " + helpImplementation + + " GENERATION.\n" ); } + + return; } }