org.apache.maven.tools.plugin.generator
Class PluginHelpGenerator

java.lang.Object
  extended by org.codehaus.plexus.logging.AbstractLogEnabled
      extended by org.apache.maven.tools.plugin.generator.PluginHelpGenerator
All Implemented Interfaces:
Generator, org.codehaus.plexus.logging.LogEnabled

public class PluginHelpGenerator
extends org.codehaus.plexus.logging.AbstractLogEnabled
implements Generator

Generates an HelpMojo class from help-class-source.vm template. The generated mojo reads help content from META-INF/maven/${groupId}/${artifactId}/plugin-help.xml resource, which is generated by this PluginDescriptorGenerator.

Notice that the help mojo source needs to be generated before compilation, but when Java 5 annotations are used, plugin descriptor content is available only after compilation (detecting annotations in .class files): help mojo source can be generated with empty package only (and no plugin descriptor available yet), then needs to be updated after compilation - through rewriteHelpMojo(PluginToolsRequest, Log) which is called from plugin descriptor XML generation.

Since:
2.4
Version:
$Id: PluginHelpGenerator.java 1406615 2012-11-07 13:26:25Z krosenvold $
Author:
Vincent Siveton

Constructor Summary
PluginHelpGenerator()
          Default constructor
 
Method Summary
 void execute(File destinationDirectory, PluginToolsRequest request)
          Execute the generation for a given plugin descriptor.
 org.codehaus.plexus.velocity.VelocityComponent getVelocityComponent()
           
 PluginHelpGenerator setHelpPackageName(String helpPackageName)
           
 PluginHelpGenerator setVelocityComponent(org.codehaus.plexus.velocity.VelocityComponent velocityComponent)
           
 
Methods inherited from class org.codehaus.plexus.logging.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PluginHelpGenerator

public PluginHelpGenerator()
Default constructor

Method Detail

execute

public void execute(File destinationDirectory,
                    PluginToolsRequest request)
             throws GeneratorException
Execute the generation for a given plugin descriptor.

Specified by:
execute in interface Generator
Parameters:
destinationDirectory - required
request - required
Throws:
GeneratorException

setHelpPackageName

public PluginHelpGenerator setHelpPackageName(String helpPackageName)

getVelocityComponent

public org.codehaus.plexus.velocity.VelocityComponent getVelocityComponent()

setVelocityComponent

public PluginHelpGenerator setVelocityComponent(org.codehaus.plexus.velocity.VelocityComponent velocityComponent)


Copyright © 2004-2012 The Apache Software Foundation. All Rights Reserved.