[UIMA-3062] fix the maven plugin annotations to proper Java 5 annotations, add needed dependency, change ParseDateTime spec for maven project to use Component annotation

git-svn-id: https://svn.apache.org/repos/asf/uima/build/trunk@1501795 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/uima-build-helper-maven-plugin/pom.xml b/uima-build-helper-maven-plugin/pom.xml
index de1ae86..513924b 100644
--- a/uima-build-helper-maven-plugin/pom.xml
+++ b/uima-build-helper-maven-plugin/pom.xml
@@ -23,7 +23,7 @@
   <parent>

     <groupId>org.apache.uima</groupId>

     <artifactId>parent-pom</artifactId>

-    <version>6-SNAPSHOT</version>

+    <version>5</version>

     <relativePath>../parent-pom</relativePath>

   </parent>

   

@@ -79,7 +79,12 @@
       <artifactId>maven-project</artifactId>

       <version>3.0-alpha-2</version>

     </dependency>

-    

+    <dependency>

+      <groupId>org.apache.maven.plugin-tools</groupId>

+      <artifactId>maven-plugin-annotations</artifactId>

+      <version>3.2</version>

+      <scope>provided</scope>

+    </dependency>

       

     <dependency>

       <groupId>junit</groupId>

diff --git a/uima-build-helper-maven-plugin/src/main/java/org/apache/uima/buildhelper/CopyFromApacheDist.java b/uima-build-helper-maven-plugin/src/main/java/org/apache/uima/buildhelper/CopyFromApacheDist.java
index a7d269e..79baa26 100644
--- a/uima-build-helper-maven-plugin/src/main/java/org/apache/uima/buildhelper/CopyFromApacheDist.java
+++ b/uima-build-helper-maven-plugin/src/main/java/org/apache/uima/buildhelper/CopyFromApacheDist.java
@@ -29,57 +29,59 @@
 
 import org.apache.maven.plugin.AbstractMojo;
 import org.apache.maven.plugin.MojoExecutionException;
+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;
 
 /**
  * Check if the requested artifact is already in the .m2 repository
  *   if so, just return
  * else, download the requested artifact from archive.apache.org/dist/uima/
  * 
- * @goal copy-from-apache-dist
- * @phase validate
- *
  */
+@Mojo( name = "copy-from-apache-dist")
+@Execute( goal = "copy-from-apache-dist", phase = LifecyclePhase.VALIDATE)
+
 public class CopyFromApacheDist extends AbstractMojo {
   private static final int MAXRETRIES = 6;
   private static final int MINTOTALSIZE = 100;
   /**
    * Group Id
-   * @Parameter ( default-value = "${project.groupId}" )
    */
+  @Parameter ( defaultValue = "${project.groupId}" )
   private String groupId;
 
   /**
    * Artifact Id
-   * @Parameter ( default-value = "uimaj" )  
    */
+  @Parameter ( defaultValue = "uimaj" )
   private String artifactId;
 
   /**
    * Version, e.g. 2.4.0
-   * @parameter
-   * @required
    */
+  @Parameter (required = true)
   private String version = null;
 
   /**
    * Type 
-   *
-   * @Parameter ( default-value = "zip" )
    */
+  @Parameter ( defaultValue = "zip" )
   private String type;
 
   /**
    * Classifier
-   *
-   * @Parameter ( default-value = "bin" )
    */
+  @Parameter ( defaultValue = "bin" )
   private String classifier;
 
   /**
    * Repository
    *
-   * @Parameter ( default-value = "${settings.localRepository}" )
+   * 
    */
+  @Parameter ( defaultValue = "${settings.localRepository}" )
   private String repository;
   
   public void execute() throws MojoExecutionException {
diff --git a/uima-build-helper-maven-plugin/src/main/java/org/apache/uima/buildhelper/ParseDateTime.java b/uima-build-helper-maven-plugin/src/main/java/org/apache/uima/buildhelper/ParseDateTime.java
index e3e4678..27d0906 100644
--- a/uima-build-helper-maven-plugin/src/main/java/org/apache/uima/buildhelper/ParseDateTime.java
+++ b/uima-build-helper-maven-plugin/src/main/java/org/apache/uima/buildhelper/ParseDateTime.java
@@ -23,6 +23,11 @@
 
 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.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;
 
 /**
@@ -32,28 +37,22 @@
  * 
  * Users specify the property name and the format of the parsing; multiple sets
  * of these can be configured to represent the same time.
- * 
- * @goal parse-date-time
- * @phase validate
  */
+@Mojo(name = "parse-date-time")
+@Execute(goal = "parse-date-time", phase = LifecyclePhase.VALIDATE)
 public class ParseDateTime extends AbstractMojo {
   /**
    * Collection of parseSpecs. Each parseSpec has a name - the property name,
    * and a format - see "Usage"
-   * 
-   * @Parameter
-   * @required
    * @since 1.0.0
    */
+  @Parameter (required = true)
   private ParseSpec[] parseSpecs;
   
   /**
    * The Maven project to analyze.
-   * 
-   * @Parameter ( expression = "${project}" )
-   * @required
-   * @readonly
    */
+  @Component
   private MavenProject project;
 
   public void execute() throws MojoExecutionException {
@@ -62,7 +61,7 @@
     
     for (int i = 0; i < parseSpecs.length; i++) {
       ParseSpec ps = parseSpecs[i]; 
-      String v = MessageFormat.format("{0,date," + ps.getFormat() + "}", now);
+      String v = MessageFormat.format("{0,date," + ps.getFormat() + "}", (Object)now);
       if (getLog().isDebugEnabled()) {
         getLog().debug("Setting property " +
             ps.getName() +
diff --git a/uima-build-helper-maven-plugin/src/main/java/org/apache/uima/buildhelper/ParseSpec.java b/uima-build-helper-maven-plugin/src/main/java/org/apache/uima/buildhelper/ParseSpec.java
index 69b34b6..85a8e64 100644
--- a/uima-build-helper-maven-plugin/src/main/java/org/apache/uima/buildhelper/ParseSpec.java
+++ b/uima-build-helper-maven-plugin/src/main/java/org/apache/uima/buildhelper/ParseSpec.java
@@ -18,24 +18,22 @@
  */

 package org.apache.uima.buildhelper;

 

+import org.apache.maven.plugins.annotations.Parameter;

+

 public class ParseSpec {

   

   /**

    * The name of the property to set

-   * 

-   * @parameter

-   * @required

    * @since 1.0.0

    */

+  @Parameter(required = true)

   private String name;

   

   /**

    * The format string to use

-   * 

-   * @parameter

-   * @required

    * @since 1.0.0

    */

+  @Parameter(required = true)

   private String format;

 

   public ParseSpec() {}