maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hbout...@apache.org
Subject svn commit: r1345787 - in /maven/plugin-tools/trunk/maven-plugin-plugin: ./ src/main/java/org/apache/maven/plugin/plugin/ src/main/java/org/apache/maven/plugin/plugin/metadata/
Date Sun, 03 Jun 2012 21:58:22 GMT
Author: hboutemy
Date: Sun Jun  3 21:58:22 2012
New Revision: 1345787

URL: http://svn.apache.org/viewvc?rev=1345787&view=rev
Log:
[MPLUGIN-209] use maven-plugin-tools' java 5 annotations

Modified:
    maven/plugin-tools/trunk/maven-plugin-plugin/pom.xml
    maven/plugin-tools/trunk/maven-plugin-plugin/src/main/java/org/apache/maven/plugin/plugin/AbstractGeneratorMojo.java
    maven/plugin-tools/trunk/maven-plugin-plugin/src/main/java/org/apache/maven/plugin/plugin/DescriptorGeneratorMojo.java
    maven/plugin-tools/trunk/maven-plugin-plugin/src/main/java/org/apache/maven/plugin/plugin/HelpGeneratorMojo.java
    maven/plugin-tools/trunk/maven-plugin-plugin/src/main/java/org/apache/maven/plugin/plugin/PluginReport.java
    maven/plugin-tools/trunk/maven-plugin-plugin/src/main/java/org/apache/maven/plugin/plugin/UpdatePluginRegistryMojo.java
    maven/plugin-tools/trunk/maven-plugin-plugin/src/main/java/org/apache/maven/plugin/plugin/XdocGeneratorMojo.java
    maven/plugin-tools/trunk/maven-plugin-plugin/src/main/java/org/apache/maven/plugin/plugin/metadata/AddPluginArtifactMetadataMojo.java

Modified: maven/plugin-tools/trunk/maven-plugin-plugin/pom.xml
URL: http://svn.apache.org/viewvc/maven/plugin-tools/trunk/maven-plugin-plugin/pom.xml?rev=1345787&r1=1345786&r2=1345787&view=diff
==============================================================================
--- maven/plugin-tools/trunk/maven-plugin-plugin/pom.xml (original)
+++ maven/plugin-tools/trunk/maven-plugin-plugin/pom.xml Sun Jun  3 21:58:22 2012
@@ -45,10 +45,16 @@
     <doxiaVersion>1.2</doxiaVersion>
     <doxia-sitetoolsVersion>1.2</doxia-sitetoolsVersion>
     <it.debug>true</it.debug>
-    <mavenPluginPluginVersion>2.9</mavenPluginPluginVersion>
+    <mavenPluginPluginVersion>3.0</mavenPluginPluginVersion>
   </properties>
 
   <dependencies>
+    <dependency>
+      <groupId>org.apache.maven.plugin-tools</groupId>
+      <artifactId>maven-plugin-tools-annotations</artifactId>
+      <version>${mavenPluginPluginVersion}</version>
+    </dependency>
+
     <!-- doxia -->
     <dependency>
       <groupId>org.apache.maven.doxia</groupId>
@@ -238,8 +244,17 @@
       <plugin>
         <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-plugin-plugin</artifactId>
+        <configuration>
+          <skipErrorNoDescriptorsFound>true</skipErrorNoDescriptorsFound>
+        </configuration>
         <executions>
           <execution>
+            <id>mojo-descriptor</id>
+            <goals>
+              <goal>descriptor</goal>
+            </goals>
+          </execution>
+          <execution>
             <id>generated-helpmojo</id>
             <goals>
               <goal>helpmojo</goal>

Modified: maven/plugin-tools/trunk/maven-plugin-plugin/src/main/java/org/apache/maven/plugin/plugin/AbstractGeneratorMojo.java
URL: http://svn.apache.org/viewvc/maven/plugin-tools/trunk/maven-plugin-plugin/src/main/java/org/apache/maven/plugin/plugin/AbstractGeneratorMojo.java?rev=1345787&r1=1345786&r2=1345787&view=diff
==============================================================================
--- maven/plugin-tools/trunk/maven-plugin-plugin/src/main/java/org/apache/maven/plugin/plugin/AbstractGeneratorMojo.java
(original)
+++ maven/plugin-tools/trunk/maven-plugin-plugin/src/main/java/org/apache/maven/plugin/plugin/AbstractGeneratorMojo.java
Sun Jun  3 21:58:22 2012
@@ -25,6 +25,8 @@ import org.apache.maven.plugin.AbstractM
 import org.apache.maven.plugin.MojoExecutionException;
 import org.apache.maven.plugin.descriptor.InvalidPluginDescriptorException;
 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.tools.plugin.DefaultPluginToolsRequest;
 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>
  * @version $Id$
- * @threadSafe
  */
 public abstract class AbstractGeneratorMojo
     extends AbstractMojo
 {
     /**
      * The project currently being built.
-     *
-     * @parameter default-value="${project}"
-     * @required
-     * @readonly
      */
+    @Component
     protected MavenProject project;
 
     /**
      * The component used for scanning the source tree for mojos.
-     *
-     * @component
-     * @required
      */
+    @Component
     protected MojoScanner mojoScanner;
 
     /**
      * The file encoding of the source files.
      *
-     * @parameter expression="${encoding}" default-value="${project.build.sourceEncoding}"
      * @since 2.5
      */
+    @Parameter( property = "encoding", defaultValue = "${project.build.sourceEncoding}" )
     protected String encoding;
 
     /**
      * The goal prefix that will appear before the ":".
-     *
-     * @parameter
      */
+    @Parameter
     protected String goalPrefix;
 
     /**
@@ -86,9 +81,9 @@ public abstract class AbstractGeneratorM
      * descriptor generator mojo is bound to generate-resources phase.
      * But for annotations, the compiled classes are needed, so skip error
      *
-     * @parameter expression="${maven.plugin.skipErrorNoDescriptorsFound}" default-value="false"
      * @since 3.0
      */
+    @Parameter( property = "maven.plugin.skipErrorNoDescriptorsFound", defaultValue = "false"
)
     protected boolean skipErrorNoDescriptorsFound;
 
     /**
@@ -113,47 +108,40 @@ public abstract class AbstractGeneratorM
      *      &lt;extractor&gt;bsh&lt;/extractor&gt;
      *  &lt;/extractors&gt;
      * </pre>
-     *
-     * @parameter
      */
+    @Parameter
     protected Set<String> extractors;
 
     /**
      * 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
      */
+    @Parameter( defaultValue = "false", property = "maven.plugin.skip" )
     protected boolean skip;
 
     /**
      * The set of dependencies for the current project
      *
-     * @parameter default-value = "${project.artifacts}"
-     * @required
-     * @readonly
      * @since 3.0
      */
+    @Parameter( defaultValue = "${project.artifacts}", required = true, readonly = true )
     protected Set<Artifact> dependencies;
 
     /**
      * List of Remote Repositories used by the resolver
      *
-     * @parameter expression="${project.remoteArtifactRepositories}"
-     * @readonly
-     * @required
      * @since 3.0
      */
+    @Parameter( defaultValue = "${project.remoteArtifactRepositories}", required = true,
readonly = true )
     protected List<ArtifactRepository> remoteRepos;
 
     /**
      * Location of the local repository.
      *
-     * @parameter expression="${localRepository}"
-     * @readonly
-     * @required
      * @since 3.0
      */
+    @Parameter( defaultValue = "${localRepository}", required = true, readonly = true )
     protected ArtifactRepository local;
 
     /**

Modified: maven/plugin-tools/trunk/maven-plugin-plugin/src/main/java/org/apache/maven/plugin/plugin/DescriptorGeneratorMojo.java
URL: http://svn.apache.org/viewvc/maven/plugin-tools/trunk/maven-plugin-plugin/src/main/java/org/apache/maven/plugin/plugin/DescriptorGeneratorMojo.java?rev=1345787&r1=1345786&r2=1345787&view=diff
==============================================================================
--- maven/plugin-tools/trunk/maven-plugin-plugin/src/main/java/org/apache/maven/plugin/plugin/DescriptorGeneratorMojo.java
(original)
+++ maven/plugin-tools/trunk/maven-plugin-plugin/src/main/java/org/apache/maven/plugin/plugin/DescriptorGeneratorMojo.java
Sun Jun  3 21:58:22 2012
@@ -20,6 +20,10 @@ package org.apache.maven.plugin.plugin;
  */
 
 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.PluginDescriptorGenerator;
 
@@ -34,26 +38,24 @@ import java.io.File;
  * @author <a href="mailto:jason@maven.org">Jason van Zyl</a>
  * @version $Id$
  * @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
     extends AbstractGeneratorMojo
 {
     /**
      * 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;
 
     /**
      * 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
      */
+    @Parameter( defaultValue = "false" )
     private boolean skipDescriptor;
 
     /** {@inheritDoc} */

Modified: maven/plugin-tools/trunk/maven-plugin-plugin/src/main/java/org/apache/maven/plugin/plugin/HelpGeneratorMojo.java
URL: http://svn.apache.org/viewvc/maven/plugin-tools/trunk/maven-plugin-plugin/src/main/java/org/apache/maven/plugin/plugin/HelpGeneratorMojo.java?rev=1345787&r1=1345786&r2=1345787&view=diff
==============================================================================
--- maven/plugin-tools/trunk/maven-plugin-plugin/src/main/java/org/apache/maven/plugin/plugin/HelpGeneratorMojo.java
(original)
+++ maven/plugin-tools/trunk/maven-plugin-plugin/src/main/java/org/apache/maven/plugin/plugin/HelpGeneratorMojo.java
Sun Jun  3 21:58:22 2012
@@ -20,6 +20,10 @@ package org.apache.maven.plugin.plugin;
  */
 
 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.PluginHelpGenerator;
 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>
  * @version $Id$
- * @goal helpmojo
- * @phase generate-sources
  * @since 2.4
  */
+@Mojo( name = "helpmojo", defaultPhase = LifecyclePhase.GENERATE_SOURCES, threadSafe = true
)
 public class HelpGeneratorMojo
     extends AbstractGeneratorMojo
 {
     /**
      * 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;
 
     /**
      * 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.
      *
-     * @parameter
      * @since 2.6
      */
+    @Parameter
     private String helpPackageName;
 
     /**
      * Velocity component.
-     *
-     * @component
-     * @readonly
-     * @required
      */
+    @Component
     private VelocityComponent velocity;
 
     /**

Modified: maven/plugin-tools/trunk/maven-plugin-plugin/src/main/java/org/apache/maven/plugin/plugin/PluginReport.java
URL: http://svn.apache.org/viewvc/maven/plugin-tools/trunk/maven-plugin-plugin/src/main/java/org/apache/maven/plugin/plugin/PluginReport.java?rev=1345787&r1=1345786&r2=1345787&view=diff
==============================================================================
--- maven/plugin-tools/trunk/maven-plugin-plugin/src/main/java/org/apache/maven/plugin/plugin/PluginReport.java
(original)
+++ maven/plugin-tools/trunk/maven-plugin-plugin/src/main/java/org/apache/maven/plugin/plugin/PluginReport.java
Sun Jun  3 21:58:22 2012
@@ -28,6 +28,11 @@ import org.apache.maven.model.ReportPlug
 import org.apache.maven.plugin.descriptor.InvalidPluginDescriptorException;
 import org.apache.maven.plugin.descriptor.MojoDescriptor;
 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.reporting.AbstractMavenReport;
 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="mailto:vincent.siveton@gmail.com">Vincent Siveton</a>
  * @version $Id$
- * @goal report
- * @execute phase="process-classes"
  * @since 2.0
  */
+@Mojo( name = "report", threadSafe = true )
+@Execute( phase = LifecyclePhase.PROCESS_CLASSES )
 public class PluginReport
     extends AbstractMavenReport
 {
     /**
      * Report output directory.
-     *
-     * @parameter default-value="${project.build.directory}/generated-site/xdoc"
      */
+    @Parameter( defaultValue = "${project.build.directory}/generated-site/xdoc" )
     private File outputDirectory;
 
     /**
      * Doxia Site Renderer.
-     *
-     * @component
      */
+    @Component
     private Renderer siteRenderer;
 
     /**
      * The Maven Project.
-     *
-     * @parameter expression="${project}"
-     * @required
-     * @readonly
      */
+    @Component
     private MavenProject project;
 
     /**
      * Mojo scanner tools.
-     *
-     * @component
      */
+    @Component
     protected MojoScanner mojoScanner;
 
     /**
      * The file encoding of the source files.
      *
-     * @parameter expression="${encoding}" default-value="${project.build.sourceEncoding}"
      * @since 2.7
      */
+    @Parameter( property = "encoding", defaultValue = "${project.build.sourceEncoding}" )
     private String encoding;
 
-
     /**
      * Specify some requirements to execute this plugin.
      * Example:
@@ -121,9 +119,8 @@ public class PluginReport
      *   &lt;/others&gt;
      * &lt;/requirements&gt;
      * </pre>
-     *
-     * @parameter
      */
+    @Parameter
     private Requirements requirements;
 
     /**
@@ -140,55 +137,49 @@ public class PluginReport
      * (There is a special for maven-plugin-plugin; it is mapped to 'plugin'.
      * </p>
      *
-     * @parameter expression="${goalPrefix}"
      * @since 2.4
      */
+    @Parameter( property = "goalPrefix" )
     protected String goalPrefix;
 
     /**
      * 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
      */
+    @Parameter( defaultValue = "false", property = "maven.plugin.skip" )
     private boolean skip;
 
     /**
      * Set this to "true" to skip generating the report.
      *
-     * @parameter default-value="false" expression="${maven.plugin.report.skip}"
      * @since 2.8
      */
+    @Parameter( defaultValue = "false", property = "maven.plugin.report.skip" )
     private boolean skipReport;
 
     /**
      * The set of dependencies for the current project
      *
-     * @parameter default-value = "${project.artifacts}"
-     * @required
-     * @readonly
      * @since 3.0
      */
+    @Parameter( defaultValue = "${project.artifacts}", required = true, readonly = true )
     protected Set<Artifact> dependencies;
 
     /**
      * List of Remote Repositories used by the resolver
      *
-     * @parameter expression="${project.remoteArtifactRepositories}"
-     * @readonly
-     * @required
      * @since 3.0
      */
+    @Parameter( defaultValue = "${project.remoteArtifactRepositories}", required = true,
readonly = true )
     protected List<ArtifactRepository> remoteRepos;
 
     /**
      * Location of the local repository.
      *
-     * @parameter expression="${localRepository}"
-     * @readonly
-     * @required
      * @since 3.0
      */
+    @Parameter( defaultValue = "${localRepository}", required = true, readonly = true )
     protected ArtifactRepository local;
 
     /**

Modified: maven/plugin-tools/trunk/maven-plugin-plugin/src/main/java/org/apache/maven/plugin/plugin/UpdatePluginRegistryMojo.java
URL: http://svn.apache.org/viewvc/maven/plugin-tools/trunk/maven-plugin-plugin/src/main/java/org/apache/maven/plugin/plugin/UpdatePluginRegistryMojo.java?rev=1345787&r1=1345786&r2=1345787&view=diff
==============================================================================
--- maven/plugin-tools/trunk/maven-plugin-plugin/src/main/java/org/apache/maven/plugin/plugin/UpdatePluginRegistryMojo.java
(original)
+++ maven/plugin-tools/trunk/maven-plugin-plugin/src/main/java/org/apache/maven/plugin/plugin/UpdatePluginRegistryMojo.java
Sun Jun  3 21:58:22 2012
@@ -29,6 +29,10 @@ import org.apache.maven.plugin.registry.
 import org.apache.maven.plugin.registry.PluginRegistryUtils;
 import org.apache.maven.plugin.registry.TrackableBase;
 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.WriterFactory;
 import org.codehaus.plexus.util.xml.pull.XmlPullParserException;
@@ -44,70 +48,56 @@ import java.util.Date;
  *
  * @version $Id$
  * @since 2.0
- * @goal updateRegistry
- * @phase install
  */
+@Mojo( name = "updateRegistry", defaultPhase = LifecyclePhase.INSTALL, threadSafe = true
)
 public class UpdatePluginRegistryMojo
     extends AbstractMojo
 {
     /**
      * Indicates whether the <code>plugin-registry.xml</code> file is used by
Maven or not
      * to manage plugin versions.
-     *
-     * @parameter default-value="${settings.usePluginRegistry}"
-     * @required
-     * @readonly
      */
+    @Parameter( defaultValue = "${settings.usePluginRegistry}", required = true, readonly
= true )
     private boolean usePluginRegistry;
 
     /**
      * 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;
 
     /**
      * 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;
 
     /**
      * 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;
 
     /**
      * Plexus component for retrieving the plugin registry info.
-     *
-     * @component role="org.apache.maven.plugin.registry.MavenPluginRegistryBuilder"
      */
+    @Component
     private MavenPluginRegistryBuilder pluginRegistryBuilder;
 
     /**
      * 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
      */
+    @Parameter( defaultValue = "false", property = "maven.plugin.skip" )
     private boolean skip;
 
     /**
      * Set this to "true" to skip updating the plugin registry.
      *
-     * @parameter default-value="false" expression="${maven.plugin.update.registry.skip}"
      * @since 2.8
      */
+    @Parameter( defaultValue = "false", property = "maven.plugin.update.registry.skip" )
     private boolean skipUpdatePluginRegistry;
 
     /** {@inheritDoc} */

Modified: maven/plugin-tools/trunk/maven-plugin-plugin/src/main/java/org/apache/maven/plugin/plugin/XdocGeneratorMojo.java
URL: http://svn.apache.org/viewvc/maven/plugin-tools/trunk/maven-plugin-plugin/src/main/java/org/apache/maven/plugin/plugin/XdocGeneratorMojo.java?rev=1345787&r1=1345786&r2=1345787&view=diff
==============================================================================
--- maven/plugin-tools/trunk/maven-plugin-plugin/src/main/java/org/apache/maven/plugin/plugin/XdocGeneratorMojo.java
(original)
+++ maven/plugin-tools/trunk/maven-plugin-plugin/src/main/java/org/apache/maven/plugin/plugin/XdocGeneratorMojo.java
Sun Jun  3 21:58:22 2012
@@ -19,6 +19,8 @@ package org.apache.maven.plugin.plugin;
  * 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.PluginXdocGenerator;
 
@@ -30,16 +32,15 @@ import java.io.File;
  * @author <a href="mailto:brett@apache.org">Brett Porter</a>
  * @version $Id$
  * @since 2.0
- * @goal xdoc
  */
+@Mojo( name = "xdoc", threadSafe = true )
 public class XdocGeneratorMojo
     extends AbstractGeneratorMojo
 {
     /**
      * 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;
 
     /** {@inheritDoc} */

Modified: maven/plugin-tools/trunk/maven-plugin-plugin/src/main/java/org/apache/maven/plugin/plugin/metadata/AddPluginArtifactMetadataMojo.java
URL: http://svn.apache.org/viewvc/maven/plugin-tools/trunk/maven-plugin-plugin/src/main/java/org/apache/maven/plugin/plugin/metadata/AddPluginArtifactMetadataMojo.java?rev=1345787&r1=1345786&r2=1345787&view=diff
==============================================================================
--- maven/plugin-tools/trunk/maven-plugin-plugin/src/main/java/org/apache/maven/plugin/plugin/metadata/AddPluginArtifactMetadataMojo.java
(original)
+++ maven/plugin-tools/trunk/maven-plugin-plugin/src/main/java/org/apache/maven/plugin/plugin/metadata/AddPluginArtifactMetadataMojo.java
Sun Jun  3 21:58:22 2012
@@ -26,6 +26,10 @@ import org.apache.maven.artifact.reposit
 import org.apache.maven.plugin.AbstractMojo;
 import org.apache.maven.plugin.MojoExecutionException;
 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;
 
 /**
@@ -42,35 +46,29 @@ import org.apache.maven.project.MavenPro
  * @see GroupRepositoryMetadata
  * @version $Id$
  * @since 2.0
- * @phase package
- * @goal addPluginArtifactMetadata
- * @threadSafe
  */
+@Mojo( name = "addPluginArtifactMetadata", defaultPhase = LifecyclePhase.PACKAGE, threadSafe
= true )
 public class AddPluginArtifactMetadataMojo
     extends AbstractMojo
 {
     /**
      * The project artifact, which should have the <code>latest</code> metadata
added to it.
-     *
-     * @parameter default-value="${project}"
-     * @required
-     * @readonly
      */
+    @Component
     private MavenProject project;
 
     /**
      * The prefix for the plugin goal.
-     *
-     * @parameter
      */
+    @Parameter
     private String goalPrefix;
 
     /**
      * 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
      */
+    @Parameter( defaultValue = "false", property = "maven.plugin.skip" )
     private boolean skip;
 
     /** {@inheritDoc} */



Mime
View raw message