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
master
Vincent Siveton 2008-02-22 12:42:27 +00:00
parent 6ccdf06649
commit a1b75b7ad8
2 changed files with 22 additions and 2 deletions

View File

@ -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 );

View File

@ -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();