[MPLUGIN-209] use maven-plugin-tools' java 5 annotations
git-svn-id: https://svn.apache.org/repos/asf/maven/plugin-tools/trunk@1345787 13f79535-47bb-0310-9956-ffa450edef68master
parent
d3bf47a4f3
commit
7230ba93e3
|
|
@ -45,10 +45,16 @@
|
||||||
<doxiaVersion>1.2</doxiaVersion>
|
<doxiaVersion>1.2</doxiaVersion>
|
||||||
<doxia-sitetoolsVersion>1.2</doxia-sitetoolsVersion>
|
<doxia-sitetoolsVersion>1.2</doxia-sitetoolsVersion>
|
||||||
<it.debug>true</it.debug>
|
<it.debug>true</it.debug>
|
||||||
<mavenPluginPluginVersion>2.9</mavenPluginPluginVersion>
|
<mavenPluginPluginVersion>3.0</mavenPluginPluginVersion>
|
||||||
</properties>
|
</properties>
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.apache.maven.plugin-tools</groupId>
|
||||||
|
<artifactId>maven-plugin-tools-annotations</artifactId>
|
||||||
|
<version>${mavenPluginPluginVersion}</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
<!-- doxia -->
|
<!-- doxia -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.apache.maven.doxia</groupId>
|
<groupId>org.apache.maven.doxia</groupId>
|
||||||
|
|
@ -238,7 +244,16 @@
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
<artifactId>maven-plugin-plugin</artifactId>
|
<artifactId>maven-plugin-plugin</artifactId>
|
||||||
|
<configuration>
|
||||||
|
<skipErrorNoDescriptorsFound>true</skipErrorNoDescriptorsFound>
|
||||||
|
</configuration>
|
||||||
<executions>
|
<executions>
|
||||||
|
<execution>
|
||||||
|
<id>mojo-descriptor</id>
|
||||||
|
<goals>
|
||||||
|
<goal>descriptor</goal>
|
||||||
|
</goals>
|
||||||
|
</execution>
|
||||||
<execution>
|
<execution>
|
||||||
<id>generated-helpmojo</id>
|
<id>generated-helpmojo</id>
|
||||||
<goals>
|
<goals>
|
||||||
|
|
|
||||||
|
|
@ -25,6 +25,8 @@ import org.apache.maven.plugin.AbstractMojo;
|
||||||
import org.apache.maven.plugin.MojoExecutionException;
|
import org.apache.maven.plugin.MojoExecutionException;
|
||||||
import org.apache.maven.plugin.descriptor.InvalidPluginDescriptorException;
|
import org.apache.maven.plugin.descriptor.InvalidPluginDescriptorException;
|
||||||
import org.apache.maven.plugin.descriptor.PluginDescriptor;
|
import org.apache.maven.plugin.descriptor.PluginDescriptor;
|
||||||
|
import org.apache.maven.plugins.annotations.Component;
|
||||||
|
import org.apache.maven.plugins.annotations.Parameter;
|
||||||
import org.apache.maven.project.MavenProject;
|
import org.apache.maven.project.MavenProject;
|
||||||
import org.apache.maven.tools.plugin.DefaultPluginToolsRequest;
|
import org.apache.maven.tools.plugin.DefaultPluginToolsRequest;
|
||||||
import org.apache.maven.tools.plugin.PluginToolsRequest;
|
import org.apache.maven.tools.plugin.PluginToolsRequest;
|
||||||
|
|
@ -44,41 +46,34 @@ import java.util.Set;
|
||||||
*
|
*
|
||||||
* @author <a href="mailto:jason@maven.org">Jason van Zyl</a>
|
* @author <a href="mailto:jason@maven.org">Jason van Zyl</a>
|
||||||
* @version $Id$
|
* @version $Id$
|
||||||
* @threadSafe
|
|
||||||
*/
|
*/
|
||||||
public abstract class AbstractGeneratorMojo
|
public abstract class AbstractGeneratorMojo
|
||||||
extends AbstractMojo
|
extends AbstractMojo
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* The project currently being built.
|
* The project currently being built.
|
||||||
*
|
|
||||||
* @parameter default-value="${project}"
|
|
||||||
* @required
|
|
||||||
* @readonly
|
|
||||||
*/
|
*/
|
||||||
|
@Component
|
||||||
protected MavenProject project;
|
protected MavenProject project;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The component used for scanning the source tree for mojos.
|
* The component used for scanning the source tree for mojos.
|
||||||
*
|
|
||||||
* @component
|
|
||||||
* @required
|
|
||||||
*/
|
*/
|
||||||
|
@Component
|
||||||
protected MojoScanner mojoScanner;
|
protected MojoScanner mojoScanner;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The file encoding of the source files.
|
* The file encoding of the source files.
|
||||||
*
|
*
|
||||||
* @parameter expression="${encoding}" default-value="${project.build.sourceEncoding}"
|
|
||||||
* @since 2.5
|
* @since 2.5
|
||||||
*/
|
*/
|
||||||
|
@Parameter( property = "encoding", defaultValue = "${project.build.sourceEncoding}" )
|
||||||
protected String encoding;
|
protected String encoding;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The goal prefix that will appear before the ":".
|
* The goal prefix that will appear before the ":".
|
||||||
*
|
|
||||||
* @parameter
|
|
||||||
*/
|
*/
|
||||||
|
@Parameter
|
||||||
protected String goalPrefix;
|
protected String goalPrefix;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -86,9 +81,9 @@ public abstract class AbstractGeneratorMojo
|
||||||
* descriptor generator mojo is bound to generate-resources phase.
|
* descriptor generator mojo is bound to generate-resources phase.
|
||||||
* But for annotations, the compiled classes are needed, so skip error
|
* But for annotations, the compiled classes are needed, so skip error
|
||||||
*
|
*
|
||||||
* @parameter expression="${maven.plugin.skipErrorNoDescriptorsFound}" default-value="false"
|
|
||||||
* @since 3.0
|
* @since 3.0
|
||||||
*/
|
*/
|
||||||
|
@Parameter( property = "maven.plugin.skipErrorNoDescriptorsFound", defaultValue = "false" )
|
||||||
protected boolean skipErrorNoDescriptorsFound;
|
protected boolean skipErrorNoDescriptorsFound;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -113,47 +108,40 @@ public abstract class AbstractGeneratorMojo
|
||||||
* <extractor>bsh</extractor>
|
* <extractor>bsh</extractor>
|
||||||
* </extractors>
|
* </extractors>
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
|
||||||
* @parameter
|
|
||||||
*/
|
*/
|
||||||
|
@Parameter
|
||||||
protected Set<String> extractors;
|
protected Set<String> extractors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set this to "true" to skip invoking any goals or reports of the plugin.
|
* Set this to "true" to skip invoking any goals or reports of the plugin.
|
||||||
*
|
*
|
||||||
* @parameter default-value="false" expression="${maven.plugin.skip}"
|
|
||||||
* @since 2.8
|
* @since 2.8
|
||||||
*/
|
*/
|
||||||
|
@Parameter( defaultValue = "false", property = "maven.plugin.skip" )
|
||||||
protected boolean skip;
|
protected boolean skip;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The set of dependencies for the current project
|
* The set of dependencies for the current project
|
||||||
*
|
*
|
||||||
* @parameter default-value = "${project.artifacts}"
|
|
||||||
* @required
|
|
||||||
* @readonly
|
|
||||||
* @since 3.0
|
* @since 3.0
|
||||||
*/
|
*/
|
||||||
|
@Parameter( defaultValue = "${project.artifacts}", required = true, readonly = true )
|
||||||
protected Set<Artifact> dependencies;
|
protected Set<Artifact> dependencies;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* List of Remote Repositories used by the resolver
|
* List of Remote Repositories used by the resolver
|
||||||
*
|
*
|
||||||
* @parameter expression="${project.remoteArtifactRepositories}"
|
|
||||||
* @readonly
|
|
||||||
* @required
|
|
||||||
* @since 3.0
|
* @since 3.0
|
||||||
*/
|
*/
|
||||||
|
@Parameter( defaultValue = "${project.remoteArtifactRepositories}", required = true, readonly = true )
|
||||||
protected List<ArtifactRepository> remoteRepos;
|
protected List<ArtifactRepository> remoteRepos;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Location of the local repository.
|
* Location of the local repository.
|
||||||
*
|
*
|
||||||
* @parameter expression="${localRepository}"
|
|
||||||
* @readonly
|
|
||||||
* @required
|
|
||||||
* @since 3.0
|
* @since 3.0
|
||||||
*/
|
*/
|
||||||
|
@Parameter( defaultValue = "${localRepository}", required = true, readonly = true )
|
||||||
protected ArtifactRepository local;
|
protected ArtifactRepository local;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -20,6 +20,10 @@ package org.apache.maven.plugin.plugin;
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import org.apache.maven.plugin.MojoExecutionException;
|
import org.apache.maven.plugin.MojoExecutionException;
|
||||||
|
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.Generator;
|
||||||
import org.apache.maven.tools.plugin.generator.PluginDescriptorGenerator;
|
import org.apache.maven.tools.plugin.generator.PluginDescriptorGenerator;
|
||||||
|
|
||||||
|
|
@ -34,26 +38,24 @@ import java.io.File;
|
||||||
* @author <a href="mailto:jason@maven.org">Jason van Zyl</a>
|
* @author <a href="mailto:jason@maven.org">Jason van Zyl</a>
|
||||||
* @version $Id$
|
* @version $Id$
|
||||||
* @since 2.0
|
* @since 2.0
|
||||||
* @goal descriptor
|
|
||||||
* @phase process-classes
|
|
||||||
* @requiresDependencyResolution runtime
|
|
||||||
*/
|
*/
|
||||||
|
@Mojo( name = "descriptor", defaultPhase = LifecyclePhase.PROCESS_CLASSES,
|
||||||
|
requiresDependencyResolution = ResolutionScope.RUNTIME, threadSafe = true )
|
||||||
public class DescriptorGeneratorMojo
|
public class DescriptorGeneratorMojo
|
||||||
extends AbstractGeneratorMojo
|
extends AbstractGeneratorMojo
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* The directory where the generated <code>plugin.xml</code> file will be put.
|
* The directory where the generated <code>plugin.xml</code> file will be put.
|
||||||
*
|
|
||||||
* @parameter default-value="${project.build.outputDirectory}/META-INF/maven"
|
|
||||||
*/
|
*/
|
||||||
|
@Parameter( defaultValue = "${project.build.outputDirectory}/META-INF/maven" )
|
||||||
protected File outputDirectory;
|
protected File outputDirectory;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A flag to disable generation of the <code>plugin.xml</code> in favor of a hand authored plugin descriptor.
|
* A flag to disable generation of the <code>plugin.xml</code> in favor of a hand authored plugin descriptor.
|
||||||
*
|
*
|
||||||
* @parameter default-value="false"
|
|
||||||
* @since 2.6
|
* @since 2.6
|
||||||
*/
|
*/
|
||||||
|
@Parameter( defaultValue = "false" )
|
||||||
private boolean skipDescriptor;
|
private boolean skipDescriptor;
|
||||||
|
|
||||||
/** {@inheritDoc} */
|
/** {@inheritDoc} */
|
||||||
|
|
|
||||||
|
|
@ -20,6 +20,10 @@ package org.apache.maven.plugin.plugin;
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import org.apache.maven.plugin.MojoExecutionException;
|
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.tools.plugin.generator.Generator;
|
import org.apache.maven.tools.plugin.generator.Generator;
|
||||||
import org.apache.maven.tools.plugin.generator.PluginHelpGenerator;
|
import org.apache.maven.tools.plugin.generator.PluginHelpGenerator;
|
||||||
import org.codehaus.plexus.velocity.VelocityComponent;
|
import org.codehaus.plexus.velocity.VelocityComponent;
|
||||||
|
|
@ -31,36 +35,31 @@ import java.io.File;
|
||||||
*
|
*
|
||||||
* @author <a href="mailto:vincent.siveton@gmail.com">Vincent Siveton</a>
|
* @author <a href="mailto:vincent.siveton@gmail.com">Vincent Siveton</a>
|
||||||
* @version $Id$
|
* @version $Id$
|
||||||
* @goal helpmojo
|
|
||||||
* @phase generate-sources
|
|
||||||
* @since 2.4
|
* @since 2.4
|
||||||
*/
|
*/
|
||||||
|
@Mojo( name = "helpmojo", defaultPhase = LifecyclePhase.GENERATE_SOURCES, threadSafe = true )
|
||||||
public class HelpGeneratorMojo
|
public class HelpGeneratorMojo
|
||||||
extends AbstractGeneratorMojo
|
extends AbstractGeneratorMojo
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* The directory where the generated <code>HelpMojo</code> file will be put.
|
* The directory where the generated <code>HelpMojo</code> file will be put.
|
||||||
*
|
|
||||||
* @parameter default-value="${project.build.directory}/generated-sources/plugin"
|
|
||||||
*/
|
*/
|
||||||
|
@Parameter( defaultValue = "${project.build.directory}/generated-sources/plugin" )
|
||||||
protected File outputDirectory;
|
protected File outputDirectory;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The name of the package for the generated <code>HelpMojo</code>. By default, the package will be calculated based
|
* The name of the package for the generated <code>HelpMojo</code>. By default, the package will be calculated based
|
||||||
* on the packages of the other plugin goals.
|
* on the packages of the other plugin goals.
|
||||||
*
|
*
|
||||||
* @parameter
|
|
||||||
* @since 2.6
|
* @since 2.6
|
||||||
*/
|
*/
|
||||||
|
@Parameter
|
||||||
private String helpPackageName;
|
private String helpPackageName;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Velocity component.
|
* Velocity component.
|
||||||
*
|
|
||||||
* @component
|
|
||||||
* @readonly
|
|
||||||
* @required
|
|
||||||
*/
|
*/
|
||||||
|
@Component
|
||||||
private VelocityComponent velocity;
|
private VelocityComponent velocity;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -28,6 +28,11 @@ import org.apache.maven.model.ReportPlugin;
|
||||||
import org.apache.maven.plugin.descriptor.InvalidPluginDescriptorException;
|
import org.apache.maven.plugin.descriptor.InvalidPluginDescriptorException;
|
||||||
import org.apache.maven.plugin.descriptor.MojoDescriptor;
|
import org.apache.maven.plugin.descriptor.MojoDescriptor;
|
||||||
import org.apache.maven.plugin.descriptor.PluginDescriptor;
|
import org.apache.maven.plugin.descriptor.PluginDescriptor;
|
||||||
|
import org.apache.maven.plugins.annotations.Component;
|
||||||
|
import org.apache.maven.plugins.annotations.Execute;
|
||||||
|
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.project.MavenProject;
|
import org.apache.maven.project.MavenProject;
|
||||||
import org.apache.maven.reporting.AbstractMavenReport;
|
import org.apache.maven.reporting.AbstractMavenReport;
|
||||||
import org.apache.maven.reporting.AbstractMavenReportRenderer;
|
import org.apache.maven.reporting.AbstractMavenReportRenderer;
|
||||||
|
|
@ -58,52 +63,45 @@ import java.util.Set;
|
||||||
* @author <a href="snicoll@apache.org">Stephane Nicoll</a>
|
* @author <a href="snicoll@apache.org">Stephane Nicoll</a>
|
||||||
* @author <a href="mailto:vincent.siveton@gmail.com">Vincent Siveton</a>
|
* @author <a href="mailto:vincent.siveton@gmail.com">Vincent Siveton</a>
|
||||||
* @version $Id$
|
* @version $Id$
|
||||||
* @goal report
|
|
||||||
* @execute phase="process-classes"
|
|
||||||
* @since 2.0
|
* @since 2.0
|
||||||
*/
|
*/
|
||||||
|
@Mojo( name = "report", threadSafe = true )
|
||||||
|
@Execute( phase = LifecyclePhase.PROCESS_CLASSES )
|
||||||
public class PluginReport
|
public class PluginReport
|
||||||
extends AbstractMavenReport
|
extends AbstractMavenReport
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Report output directory.
|
* Report output directory.
|
||||||
*
|
|
||||||
* @parameter default-value="${project.build.directory}/generated-site/xdoc"
|
|
||||||
*/
|
*/
|
||||||
|
@Parameter( defaultValue = "${project.build.directory}/generated-site/xdoc" )
|
||||||
private File outputDirectory;
|
private File outputDirectory;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Doxia Site Renderer.
|
* Doxia Site Renderer.
|
||||||
*
|
|
||||||
* @component
|
|
||||||
*/
|
*/
|
||||||
|
@Component
|
||||||
private Renderer siteRenderer;
|
private Renderer siteRenderer;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The Maven Project.
|
* The Maven Project.
|
||||||
*
|
|
||||||
* @parameter expression="${project}"
|
|
||||||
* @required
|
|
||||||
* @readonly
|
|
||||||
*/
|
*/
|
||||||
|
@Component
|
||||||
private MavenProject project;
|
private MavenProject project;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Mojo scanner tools.
|
* Mojo scanner tools.
|
||||||
*
|
|
||||||
* @component
|
|
||||||
*/
|
*/
|
||||||
|
@Component
|
||||||
protected MojoScanner mojoScanner;
|
protected MojoScanner mojoScanner;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The file encoding of the source files.
|
* The file encoding of the source files.
|
||||||
*
|
*
|
||||||
* @parameter expression="${encoding}" default-value="${project.build.sourceEncoding}"
|
|
||||||
* @since 2.7
|
* @since 2.7
|
||||||
*/
|
*/
|
||||||
|
@Parameter( property = "encoding", defaultValue = "${project.build.sourceEncoding}" )
|
||||||
private String encoding;
|
private String encoding;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Specify some requirements to execute this plugin.
|
* Specify some requirements to execute this plugin.
|
||||||
* Example:
|
* Example:
|
||||||
|
|
@ -121,9 +119,8 @@ public class PluginReport
|
||||||
* </others>
|
* </others>
|
||||||
* </requirements>
|
* </requirements>
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
|
||||||
* @parameter
|
|
||||||
*/
|
*/
|
||||||
|
@Parameter
|
||||||
private Requirements requirements;
|
private Requirements requirements;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -140,55 +137,49 @@ public class PluginReport
|
||||||
* (There is a special for maven-plugin-plugin; it is mapped to 'plugin'.
|
* (There is a special for maven-plugin-plugin; it is mapped to 'plugin'.
|
||||||
* </p>
|
* </p>
|
||||||
*
|
*
|
||||||
* @parameter expression="${goalPrefix}"
|
|
||||||
* @since 2.4
|
* @since 2.4
|
||||||
*/
|
*/
|
||||||
|
@Parameter( property = "goalPrefix" )
|
||||||
protected String goalPrefix;
|
protected String goalPrefix;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set this to "true" to skip invoking any goals or reports of the plugin.
|
* Set this to "true" to skip invoking any goals or reports of the plugin.
|
||||||
*
|
*
|
||||||
* @parameter default-value="false" expression="${maven.plugin.skip}"
|
|
||||||
* @since 2.8
|
* @since 2.8
|
||||||
*/
|
*/
|
||||||
|
@Parameter( defaultValue = "false", property = "maven.plugin.skip" )
|
||||||
private boolean skip;
|
private boolean skip;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set this to "true" to skip generating the report.
|
* Set this to "true" to skip generating the report.
|
||||||
*
|
*
|
||||||
* @parameter default-value="false" expression="${maven.plugin.report.skip}"
|
|
||||||
* @since 2.8
|
* @since 2.8
|
||||||
*/
|
*/
|
||||||
|
@Parameter( defaultValue = "false", property = "maven.plugin.report.skip" )
|
||||||
private boolean skipReport;
|
private boolean skipReport;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The set of dependencies for the current project
|
* The set of dependencies for the current project
|
||||||
*
|
*
|
||||||
* @parameter default-value = "${project.artifacts}"
|
|
||||||
* @required
|
|
||||||
* @readonly
|
|
||||||
* @since 3.0
|
* @since 3.0
|
||||||
*/
|
*/
|
||||||
|
@Parameter( defaultValue = "${project.artifacts}", required = true, readonly = true )
|
||||||
protected Set<Artifact> dependencies;
|
protected Set<Artifact> dependencies;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* List of Remote Repositories used by the resolver
|
* List of Remote Repositories used by the resolver
|
||||||
*
|
*
|
||||||
* @parameter expression="${project.remoteArtifactRepositories}"
|
|
||||||
* @readonly
|
|
||||||
* @required
|
|
||||||
* @since 3.0
|
* @since 3.0
|
||||||
*/
|
*/
|
||||||
|
@Parameter( defaultValue = "${project.remoteArtifactRepositories}", required = true, readonly = true )
|
||||||
protected List<ArtifactRepository> remoteRepos;
|
protected List<ArtifactRepository> remoteRepos;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Location of the local repository.
|
* Location of the local repository.
|
||||||
*
|
*
|
||||||
* @parameter expression="${localRepository}"
|
|
||||||
* @readonly
|
|
||||||
* @required
|
|
||||||
* @since 3.0
|
* @since 3.0
|
||||||
*/
|
*/
|
||||||
|
@Parameter( defaultValue = "${localRepository}", required = true, readonly = true )
|
||||||
protected ArtifactRepository local;
|
protected ArtifactRepository local;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -29,6 +29,10 @@ import org.apache.maven.plugin.registry.PluginRegistry;
|
||||||
import org.apache.maven.plugin.registry.PluginRegistryUtils;
|
import org.apache.maven.plugin.registry.PluginRegistryUtils;
|
||||||
import org.apache.maven.plugin.registry.TrackableBase;
|
import org.apache.maven.plugin.registry.TrackableBase;
|
||||||
import org.apache.maven.plugin.registry.io.xpp3.PluginRegistryXpp3Writer;
|
import org.apache.maven.plugin.registry.io.xpp3.PluginRegistryXpp3Writer;
|
||||||
|
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.codehaus.plexus.util.IOUtil;
|
import org.codehaus.plexus.util.IOUtil;
|
||||||
import org.codehaus.plexus.util.WriterFactory;
|
import org.codehaus.plexus.util.WriterFactory;
|
||||||
import org.codehaus.plexus.util.xml.pull.XmlPullParserException;
|
import org.codehaus.plexus.util.xml.pull.XmlPullParserException;
|
||||||
|
|
@ -44,70 +48,56 @@ import java.util.Date;
|
||||||
*
|
*
|
||||||
* @version $Id$
|
* @version $Id$
|
||||||
* @since 2.0
|
* @since 2.0
|
||||||
* @goal updateRegistry
|
|
||||||
* @phase install
|
|
||||||
*/
|
*/
|
||||||
|
@Mojo( name = "updateRegistry", defaultPhase = LifecyclePhase.INSTALL, threadSafe = true )
|
||||||
public class UpdatePluginRegistryMojo
|
public class UpdatePluginRegistryMojo
|
||||||
extends AbstractMojo
|
extends AbstractMojo
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Indicates whether the <code>plugin-registry.xml</code> file is used by Maven or not
|
* Indicates whether the <code>plugin-registry.xml</code> file is used by Maven or not
|
||||||
* to manage plugin versions.
|
* to manage plugin versions.
|
||||||
*
|
|
||||||
* @parameter default-value="${settings.usePluginRegistry}"
|
|
||||||
* @required
|
|
||||||
* @readonly
|
|
||||||
*/
|
*/
|
||||||
|
@Parameter( defaultValue = "${settings.usePluginRegistry}", required = true, readonly = true )
|
||||||
private boolean usePluginRegistry;
|
private boolean usePluginRegistry;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The group id of the project currently being built.
|
* The group id of the project currently being built.
|
||||||
*
|
|
||||||
* @parameter default-value="${project.groupId}"
|
|
||||||
* @required
|
|
||||||
* @readonly
|
|
||||||
*/
|
*/
|
||||||
|
@Parameter( defaultValue = "${project.groupId}", required = true, readonly = true )
|
||||||
private String groupId;
|
private String groupId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The artifact id of the project currently being built.
|
* The artifact id of the project currently being built.
|
||||||
*
|
|
||||||
* @parameter default-value="${project.artifactId}"
|
|
||||||
* @required
|
|
||||||
* @readonly
|
|
||||||
*/
|
*/
|
||||||
|
@Parameter( defaultValue = "${project.artifactId}", required = true, readonly = true )
|
||||||
private String artifactId;
|
private String artifactId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The version of the project currently being built.
|
* The version of the project currently being built.
|
||||||
*
|
|
||||||
* @parameter default-value="${project.artifact.version}"
|
|
||||||
* @required
|
|
||||||
* @readonly
|
|
||||||
*/
|
*/
|
||||||
|
@Parameter( defaultValue = "${project.artifact.version}", required = true, readonly = true )
|
||||||
private String version;
|
private String version;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Plexus component for retrieving the plugin registry info.
|
* Plexus component for retrieving the plugin registry info.
|
||||||
*
|
|
||||||
* @component role="org.apache.maven.plugin.registry.MavenPluginRegistryBuilder"
|
|
||||||
*/
|
*/
|
||||||
|
@Component
|
||||||
private MavenPluginRegistryBuilder pluginRegistryBuilder;
|
private MavenPluginRegistryBuilder pluginRegistryBuilder;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set this to "true" to skip invoking any goals or reports of the plugin.
|
* Set this to "true" to skip invoking any goals or reports of the plugin.
|
||||||
*
|
*
|
||||||
* @parameter default-value="false" expression="${maven.plugin.skip}"
|
|
||||||
* @since 2.8
|
* @since 2.8
|
||||||
*/
|
*/
|
||||||
|
@Parameter( defaultValue = "false", property = "maven.plugin.skip" )
|
||||||
private boolean skip;
|
private boolean skip;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set this to "true" to skip updating the plugin registry.
|
* Set this to "true" to skip updating the plugin registry.
|
||||||
*
|
*
|
||||||
* @parameter default-value="false" expression="${maven.plugin.update.registry.skip}"
|
|
||||||
* @since 2.8
|
* @since 2.8
|
||||||
*/
|
*/
|
||||||
|
@Parameter( defaultValue = "false", property = "maven.plugin.update.registry.skip" )
|
||||||
private boolean skipUpdatePluginRegistry;
|
private boolean skipUpdatePluginRegistry;
|
||||||
|
|
||||||
/** {@inheritDoc} */
|
/** {@inheritDoc} */
|
||||||
|
|
|
||||||
|
|
@ -19,6 +19,8 @@ package org.apache.maven.plugin.plugin;
|
||||||
* under the License.
|
* under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
import org.apache.maven.plugins.annotations.Mojo;
|
||||||
|
import org.apache.maven.plugins.annotations.Parameter;
|
||||||
import org.apache.maven.tools.plugin.generator.Generator;
|
import org.apache.maven.tools.plugin.generator.Generator;
|
||||||
import org.apache.maven.tools.plugin.generator.PluginXdocGenerator;
|
import org.apache.maven.tools.plugin.generator.PluginXdocGenerator;
|
||||||
|
|
||||||
|
|
@ -30,16 +32,15 @@ import java.io.File;
|
||||||
* @author <a href="mailto:brett@apache.org">Brett Porter</a>
|
* @author <a href="mailto:brett@apache.org">Brett Porter</a>
|
||||||
* @version $Id$
|
* @version $Id$
|
||||||
* @since 2.0
|
* @since 2.0
|
||||||
* @goal xdoc
|
|
||||||
*/
|
*/
|
||||||
|
@Mojo( name = "xdoc", threadSafe = true )
|
||||||
public class XdocGeneratorMojo
|
public class XdocGeneratorMojo
|
||||||
extends AbstractGeneratorMojo
|
extends AbstractGeneratorMojo
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* The directory where the generated Xdoc files will be put.
|
* The directory where the generated Xdoc files will be put.
|
||||||
*
|
|
||||||
* @parameter default-value="${project.build.directory}/generated-site/xdoc"
|
|
||||||
*/
|
*/
|
||||||
|
@Parameter( defaultValue = "${project.build.directory}/generated-site/xdoc" )
|
||||||
protected File outputDirectory;
|
protected File outputDirectory;
|
||||||
|
|
||||||
/** {@inheritDoc} */
|
/** {@inheritDoc} */
|
||||||
|
|
|
||||||
|
|
@ -26,6 +26,10 @@ import org.apache.maven.artifact.repository.metadata.Versioning;
|
||||||
import org.apache.maven.plugin.AbstractMojo;
|
import org.apache.maven.plugin.AbstractMojo;
|
||||||
import org.apache.maven.plugin.MojoExecutionException;
|
import org.apache.maven.plugin.MojoExecutionException;
|
||||||
import org.apache.maven.plugin.descriptor.PluginDescriptor;
|
import org.apache.maven.plugin.descriptor.PluginDescriptor;
|
||||||
|
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.project.MavenProject;
|
import org.apache.maven.project.MavenProject;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -42,35 +46,29 @@ import org.apache.maven.project.MavenProject;
|
||||||
* @see GroupRepositoryMetadata
|
* @see GroupRepositoryMetadata
|
||||||
* @version $Id$
|
* @version $Id$
|
||||||
* @since 2.0
|
* @since 2.0
|
||||||
* @phase package
|
|
||||||
* @goal addPluginArtifactMetadata
|
|
||||||
* @threadSafe
|
|
||||||
*/
|
*/
|
||||||
|
@Mojo( name = "addPluginArtifactMetadata", defaultPhase = LifecyclePhase.PACKAGE, threadSafe = true )
|
||||||
public class AddPluginArtifactMetadataMojo
|
public class AddPluginArtifactMetadataMojo
|
||||||
extends AbstractMojo
|
extends AbstractMojo
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* The project artifact, which should have the <code>latest</code> metadata added to it.
|
* The project artifact, which should have the <code>latest</code> metadata added to it.
|
||||||
*
|
|
||||||
* @parameter default-value="${project}"
|
|
||||||
* @required
|
|
||||||
* @readonly
|
|
||||||
*/
|
*/
|
||||||
|
@Component
|
||||||
private MavenProject project;
|
private MavenProject project;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The prefix for the plugin goal.
|
* The prefix for the plugin goal.
|
||||||
*
|
|
||||||
* @parameter
|
|
||||||
*/
|
*/
|
||||||
|
@Parameter
|
||||||
private String goalPrefix;
|
private String goalPrefix;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set this to "true" to skip invoking any goals or reports of the plugin.
|
* Set this to "true" to skip invoking any goals or reports of the plugin.
|
||||||
*
|
*
|
||||||
* @parameter default-value="false" expression="${maven.plugin.skip}"
|
|
||||||
* @since 2.8
|
* @since 2.8
|
||||||
*/
|
*/
|
||||||
|
@Parameter( defaultValue = "false", property = "maven.plugin.skip" )
|
||||||
private boolean skip;
|
private boolean skip;
|
||||||
|
|
||||||
/** {@inheritDoc} */
|
/** {@inheritDoc} */
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue