From a1b75b7ad8aa09519f49260c68a56c8cd856ed6d Mon Sep 17 00:00:00 2001 From: Vincent Siveton Date: Fri, 22 Feb 2008 12:42:27 +0000 Subject: [PATCH] MPLUGIN-28: Error of goal value in Plugin documentation generation o added a goal prefix parameter o updated warn msg git-svn-id: https://svn.apache.org/repos/asf/maven/plugin-tools/trunk@630181 13f79535-47bb-0310-9956-ffa450edef68 --- .../plugin/plugin/AbstractGeneratorMojo.java | 3 ++- .../maven/plugin/plugin/PluginReport.java | 21 ++++++++++++++++++- 2 files changed, 22 insertions(+), 2 deletions(-) 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();