diff --git a/maven-plugin-plugin/src/main/java/org/apache/maven/plugin/plugin/AbstractGeneratorMojo.java b/maven-plugin-plugin/src/main/java/org/apache/maven/plugin/plugin/AbstractGeneratorMojo.java index 8418a2f..2c99934 100644 --- a/maven-plugin-plugin/src/main/java/org/apache/maven/plugin/plugin/AbstractGeneratorMojo.java +++ b/maven-plugin-plugin/src/main/java/org/apache/maven/plugin/plugin/AbstractGeneratorMojo.java @@ -109,7 +109,8 @@ public abstract class AbstractGeneratorMojo else { getLog().warn( - "Goal prefix is: " + goalPrefix + "; Maven currently expects it to be " + defaultGoalPrefix ); + "\n\nGoal prefix is specified as: '" + goalPrefix + "'. " + + "Maven currently expects it to be '" + defaultGoalPrefix + "'.\n" ); } mojoScanner.setActiveExtractors( extractors ); diff --git a/maven-plugin-plugin/src/main/java/org/apache/maven/plugin/plugin/PluginReport.java b/maven-plugin-plugin/src/main/java/org/apache/maven/plugin/plugin/PluginReport.java index f9cc40e..f4dbc98 100644 --- a/maven-plugin-plugin/src/main/java/org/apache/maven/plugin/plugin/PluginReport.java +++ b/maven-plugin-plugin/src/main/java/org/apache/maven/plugin/plugin/PluginReport.java @@ -108,6 +108,14 @@ public class PluginReport */ private Requirements requirements; + /** + * The goal prefix that will appear before the ":". + * + * @parameter expression="${goalPrefix}" + * @since 2.4 + */ + protected String goalPrefix; + /** {@inheritDoc} */ protected Renderer getSiteRenderer() { @@ -135,7 +143,18 @@ public class PluginReport return; } - String goalPrefix = PluginDescriptor.getGoalPrefixFromArtifactId( project.getArtifactId() ); + // Copy from AbstractGeneratorMojo#execute() + String defaultGoalPrefix = PluginDescriptor.getGoalPrefixFromArtifactId( project.getArtifactId() ); + if ( goalPrefix == null ) + { + goalPrefix = defaultGoalPrefix; + } + else + { + getLog().warn( + "\n\nGoal prefix is specified as: '" + goalPrefix + "'. Maven currently expects it to be '" + + defaultGoalPrefix + "'.\n" ); + } // TODO: could use this more, eg in the writing of the plugin descriptor! PluginDescriptor pluginDescriptor = new PluginDescriptor();