[MPLUGIN-231] Switch to plugin annotations for the generated help-mojo if the Maven Plugin depends on maven-plugin-annotations
git-svn-id: https://svn.apache.org/repos/asf/maven/plugin-tools/trunk@1405379 13f79535-47bb-0310-9956-ffa450edef68master
parent
0435027899
commit
6e6ee108b7
|
|
@ -19,17 +19,18 @@ package org.apache.maven.plugin.plugin;
|
|||
* under the License.
|
||||
*/
|
||||
|
||||
import java.io.File;
|
||||
|
||||
import org.apache.maven.plugin.MojoExecutionException;
|
||||
import org.apache.maven.plugins.annotations.Component;
|
||||
import org.apache.maven.plugins.annotations.LifecyclePhase;
|
||||
import org.apache.maven.plugins.annotations.Mojo;
|
||||
import org.apache.maven.plugins.annotations.Parameter;
|
||||
import org.apache.maven.plugins.annotations.ResolutionScope;
|
||||
import org.apache.maven.tools.plugin.generator.Generator;
|
||||
import org.apache.maven.tools.plugin.generator.PluginHelpGenerator;
|
||||
import org.codehaus.plexus.velocity.VelocityComponent;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
/**
|
||||
* Generates a <code>HelpMojo</code> class.
|
||||
*
|
||||
|
|
@ -37,7 +38,7 @@ import java.io.File;
|
|||
* @version $Id$
|
||||
* @since 2.4
|
||||
*/
|
||||
@Mojo( name = "helpmojo", defaultPhase = LifecyclePhase.GENERATE_SOURCES, threadSafe = true /*, requiresDependencyResolution = ResolutionScope.COMPILE */ )
|
||||
@Mojo( name = "helpmojo", defaultPhase = LifecyclePhase.GENERATE_SOURCES, threadSafe = true, requiresDependencyResolution = ResolutionScope.COMPILE )
|
||||
public class HelpGeneratorMojo
|
||||
extends AbstractGeneratorMojo
|
||||
{
|
||||
|
|
|
|||
|
|
@ -4,6 +4,11 @@ package ${helpPackageName};
|
|||
|
||||
import org.apache.maven.plugin.AbstractMojo;
|
||||
import org.apache.maven.plugin.MojoExecutionException;
|
||||
#if ( $useAnnotations )
|
||||
import org.apache.maven.plugins.annotations.Mojo;
|
||||
import org.apache.maven.plugins.annotations.Parameter;
|
||||
#end
|
||||
|
||||
import org.w3c.dom.Document;
|
||||
import org.w3c.dom.Element;
|
||||
import org.w3c.dom.Node;
|
||||
|
|
@ -24,10 +29,15 @@ import java.util.List;
|
|||
* Call <code>mvn ${goalPrefix}:help -Ddetail=true -Dgoal=<goal-name></code> to display parameter details.
|
||||
* @author
|
||||
* @version
|
||||
#if ( !$useAnnotations )
|
||||
* @goal help
|
||||
* @requiresProject false
|
||||
* @threadSafe
|
||||
#end
|
||||
*/
|
||||
#if ( $useAnnotations )
|
||||
@Mojo( name = "help", requiresProject = false, threadSafe = true )
|
||||
#end
|
||||
public class HelpMojo
|
||||
extends AbstractMojo
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in New Issue