[MSTAGE-15] use maven-plugin-tools' java 5 annotations


git-svn-id: https://svn.apache.org/repos/asf/maven/plugins/trunk@1360161 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/pom.xml b/pom.xml
index 796366f..81fa2f9 100644
--- a/pom.xml
+++ b/pom.xml
@@ -25,7 +25,7 @@
   <parent>
     <groupId>org.apache.maven.plugins</groupId>
     <artifactId>maven-plugins</artifactId>
-    <version>21</version>
+    <version>22</version>
     <relativePath>../maven-plugins/pom.xml</relativePath>
   </parent>
 
@@ -79,6 +79,11 @@
       <version>${mavenVersion}</version>
     </dependency>
     <dependency>
+      <groupId>org.apache.maven.plugin-tools</groupId>
+      <artifactId>maven-plugin-annotations</artifactId>
+      <version>3.1</version>
+    </dependency>
+    <dependency>
       <groupId>org.apache.maven.wagon</groupId>
       <artifactId>wagon-file</artifactId>
       <version>${wagonVersion}</version>
@@ -114,7 +119,7 @@
     <dependency>
       <groupId>org.codehaus.plexus</groupId>
       <artifactId>plexus-utils</artifactId>
-      <version>1.4.1</version>
+      <version>3.0.1</version>
     </dependency>
     <dependency>
       <groupId>junit</groupId>
@@ -128,6 +133,13 @@
     <pluginManagement>
       <plugins>
         <plugin>
+          <artifactId>maven-plugin-plugin</artifactId>
+          <version>3.1</version>
+          <configuration>
+            <skipErrorNoDescriptorsFound>true</skipErrorNoDescriptorsFound>
+          </configuration>
+        </plugin>
+        <plugin>
           <groupId>org.apache.maven.plugins</groupId>
           <artifactId>maven-site-plugin</artifactId>
           <version>2.0</version>
@@ -148,6 +160,17 @@
         </executions>
       </plugin>
       <plugin>
+        <artifactId>maven-plugin-plugin</artifactId>
+        <executions>
+          <execution>
+            <id>generate-descriptor</id>
+            <goals>
+              <goal>descriptor</goal>
+            </goals>
+          </execution>
+        </executions>
+      </plugin>
+      <plugin>
         <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-surefire-plugin</artifactId>
         <configuration>
diff --git a/src/main/java/org/apache/maven/plugins/stage/CopyRepositoryMojo.java b/src/main/java/org/apache/maven/plugins/stage/CopyRepositoryMojo.java
index 4308f2b..76a2896 100644
--- a/src/main/java/org/apache/maven/plugins/stage/CopyRepositoryMojo.java
+++ b/src/main/java/org/apache/maven/plugins/stage/CopyRepositoryMojo.java
@@ -21,6 +21,9 @@
 
 import org.apache.maven.plugin.AbstractMojo;
 import org.apache.maven.plugin.MojoExecutionException;
+import org.apache.maven.plugins.annotations.Component;
+import org.apache.maven.plugins.annotations.Mojo;
+import org.apache.maven.plugins.annotations.Parameter;
 import org.apache.maven.wagon.WagonException;
 import org.apache.maven.wagon.repository.Repository;
 
@@ -30,43 +33,38 @@
  * Copies artifacts from one repository to another repository.
  * 
  * @author Jason van Zyl
- * @requiresProject false
- * @goal copy
  */
+@Mojo( name = "copy", requiresProject = false )
 public class CopyRepositoryMojo
     extends AbstractMojo
 {
     /**
      * The URL to the source repository.
-     *
-     * @parameter expression="${source}"
      */
+    @Parameter( property = "source" )
     private String source;
 
     /**
      * The URL to the target repository.
-     * 
+     * <p/>
      * <p>
      * <strong>Note:</strong> currently only <code>scp:</code> URLs are allowed
      * as a target URL.
      * </p>
-     * 
-     * @parameter expression="${target}"
      */
+    @Parameter( property = "target" )
     private String target;
 
     /**
      * The id of the source repository, required if you need the configuration from the user settings.
-     * 
-     * @parameter expression="${sourceRepositoryId}" default-value="source"
      */
+    @Parameter( property = "sourceRepositoryId", defaultValue = "source" )
     private String sourceRepositoryId;
 
     /**
      * The id of the target repository, required if you need the configuration from the user settings.
-     * 
-     * @parameter expression="${targetRepositoryId}" default-value="target"
      */
+    @Parameter( property = "targetRepositoryId", defaultValue = "target" )
     private String targetRepositoryId;
 
     /**
@@ -75,17 +73,14 @@
      * <b>Note:</b> This is currently only used for naming temporary files.
      * <i>All</i> versions of the artifacts will be copied.
      * </p>
-     *
-     * @parameter expression="${version}"
-     * @required
      */
+    @Parameter( property = "version", required = true )
     private String version;
 
     /**
      * The repository copier to use.
-     *
-     * @component
      */
+    @Component
     private RepositoryCopier copier;
 
     public void execute()