[MPLUGIN-217] HelpMojo (always) contains description for the maven-plugin-plugin

Submitted by Tony Chemit.

git-svn-id: https://svn.apache.org/repos/asf/maven/plugin-tools/trunk@1353837 13f79535-47bb-0310-9956-ffa450edef68
master
Olivier Lamy 2012-06-26 07:03:11 +00:00
parent 2892e3570d
commit 0ac08a36fc
2 changed files with 7 additions and 4 deletions

View File

@ -155,7 +155,7 @@ public class PluginHelpGenerator
try
{
writer = new OutputStreamWriter( new FileOutputStream( helpClass ), request.getEncoding() );
writer.write( getHelpClassSources( propertiesFilePath ) );
writer.write( getHelpClassSources( propertiesFilePath, pluginDescriptor ) );
writer.flush();
}
catch ( IOException e )
@ -189,7 +189,7 @@ public class PluginHelpGenerator
// Private methods
// ----------------------------------------------------------------------
protected String getHelpClassSources( String propertiesFilePath )
protected String getHelpClassSources( String propertiesFilePath, PluginDescriptor pluginDescriptor )
{
Properties properties = new Properties();
VelocityContext context = new VelocityContext( properties );
@ -202,6 +202,9 @@ public class PluginHelpGenerator
properties.put( "helpPackageName", "" );
}
properties.put( "pluginHelpPath", propertiesFilePath + "/plugin-help.xml" );
properties.put( "artifactId", pluginDescriptor.getArtifactId());
properties.put( "goalPrefix", pluginDescriptor.getGoalPrefix());
// FIXME encoding !
StringWriter stringWriter = new StringWriter();

View File

@ -17,8 +17,8 @@ import java.util.Iterator;
import java.util.List;
/**
* Display help information on maven-plugin-plugin.<br/>
* Call <code>mvn plugin:help -Ddetail=true -Dgoal=&lt;goal-name&gt;</code> to display parameter details.
* Display help information on ${artifactId}.<br/>
* Call <code>mvn ${goalPrefix}:help -Ddetail=true -Dgoal=&lt;goal-name&gt;</code> to display parameter details.
* @author
* @version
* @goal help