You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@uima.apache.org by sc...@apache.org on 2013/07/10 17:23:58 UTC
svn commit: r1501795 - in /uima/build/trunk/uima-build-helper-maven-plugin:
./ src/main/java/org/apache/uima/buildhelper/
Author: schor
Date: Wed Jul 10 15:23:57 2013
New Revision: 1501795
URL: http://svn.apache.org/r1501795
Log:
[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
Modified:
uima/build/trunk/uima-build-helper-maven-plugin/pom.xml
uima/build/trunk/uima-build-helper-maven-plugin/src/main/java/org/apache/uima/buildhelper/CopyFromApacheDist.java
uima/build/trunk/uima-build-helper-maven-plugin/src/main/java/org/apache/uima/buildhelper/ParseDateTime.java
uima/build/trunk/uima-build-helper-maven-plugin/src/main/java/org/apache/uima/buildhelper/ParseSpec.java
Modified: uima/build/trunk/uima-build-helper-maven-plugin/pom.xml
URL: http://svn.apache.org/viewvc/uima/build/trunk/uima-build-helper-maven-plugin/pom.xml?rev=1501795&r1=1501794&r2=1501795&view=diff
==============================================================================
--- uima/build/trunk/uima-build-helper-maven-plugin/pom.xml (original)
+++ uima/build/trunk/uima-build-helper-maven-plugin/pom.xml Wed Jul 10 15:23:57 2013
@@ -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>
Modified: uima/build/trunk/uima-build-helper-maven-plugin/src/main/java/org/apache/uima/buildhelper/CopyFromApacheDist.java
URL: http://svn.apache.org/viewvc/uima/build/trunk/uima-build-helper-maven-plugin/src/main/java/org/apache/uima/buildhelper/CopyFromApacheDist.java?rev=1501795&r1=1501794&r2=1501795&view=diff
==============================================================================
--- uima/build/trunk/uima-build-helper-maven-plugin/src/main/java/org/apache/uima/buildhelper/CopyFromApacheDist.java (original)
+++ uima/build/trunk/uima-build-helper-maven-plugin/src/main/java/org/apache/uima/buildhelper/CopyFromApacheDist.java Wed Jul 10 15:23:57 2013
@@ -29,57 +29,59 @@ import java.net.URL;
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 {
Modified: uima/build/trunk/uima-build-helper-maven-plugin/src/main/java/org/apache/uima/buildhelper/ParseDateTime.java
URL: http://svn.apache.org/viewvc/uima/build/trunk/uima-build-helper-maven-plugin/src/main/java/org/apache/uima/buildhelper/ParseDateTime.java?rev=1501795&r1=1501794&r2=1501795&view=diff
==============================================================================
--- uima/build/trunk/uima-build-helper-maven-plugin/src/main/java/org/apache/uima/buildhelper/ParseDateTime.java (original)
+++ uima/build/trunk/uima-build-helper-maven-plugin/src/main/java/org/apache/uima/buildhelper/ParseDateTime.java Wed Jul 10 15:23:57 2013
@@ -23,6 +23,11 @@ import java.util.Date;
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 @@ import org.apache.maven.project.MavenPro
*
* 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 @@ public class ParseDateTime extends Abstr
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() +
Modified: uima/build/trunk/uima-build-helper-maven-plugin/src/main/java/org/apache/uima/buildhelper/ParseSpec.java
URL: http://svn.apache.org/viewvc/uima/build/trunk/uima-build-helper-maven-plugin/src/main/java/org/apache/uima/buildhelper/ParseSpec.java?rev=1501795&r1=1501794&r2=1501795&view=diff
==============================================================================
--- uima/build/trunk/uima-build-helper-maven-plugin/src/main/java/org/apache/uima/buildhelper/ParseSpec.java (original)
+++ uima/build/trunk/uima-build-helper-maven-plugin/src/main/java/org/apache/uima/buildhelper/ParseSpec.java Wed Jul 10 15:23:57 2013
@@ -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() {}