Changing Maven plugin to use annotations API.

This was needed now otherwise we wouldn't be able to process javadoc properly without -Xdoclint on JDK 1.8
This commit is contained in:
Clebert Suconic 2015-06-09 21:09:11 -04:00
parent ff01b2ea84
commit fd93a7c268
5 changed files with 61 additions and 48 deletions

View File

@ -35,7 +35,7 @@
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-plugin-api</artifactId>
<version>2.0</version>
<version>3.3.3</version>
</dependency>
<dependency>
<groupId>org.apache.maven.plugins</groupId>
@ -56,37 +56,54 @@
<groupId>io.netty</groupId>
<artifactId>netty-all</artifactId>
</dependency>
<dependency>
<groupId>org.apache.maven.plugin-tools</groupId>
<artifactId>maven-plugin-annotations</artifactId>
<version>3.4</version>
<scope>provided</scope>
</dependency>
</dependencies>
<build>
<pluginManagement>
<plugins>
<!--This plugin's configuration is used to store Eclipse m2e settings only. It has no influence on the Maven build itself.-->
<plugin>
<groupId>org.eclipse.m2e</groupId>
<artifactId>lifecycle-mapping</artifactId>
<version>1.0.0</version>
<configuration>
<lifecycleMappingMetadata>
<pluginExecutions>
<pluginExecution>
<pluginExecutionFilter>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-plugin-plugin</artifactId>
<versionRange>[3.3,)</versionRange>
<goals>
<goal>descriptor</goal>
</goals>
</pluginExecutionFilter>
<action>
<ignore></ignore>
</action>
</pluginExecution>
</pluginExecutions>
</lifecycleMappingMetadata>
</configuration>
</plugin>
</plugins>
</pluginManagement>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-plugin-plugin</artifactId>
<version>3.4</version>
<executions>
<execution>
<id>default-descriptor</id>
<phase>process-classes</phase>
</execution>
</executions>
</plugin>
<!--This plugin's configuration is used to store Eclipse m2e settings only. It has no influence on the Maven build itself.-->
<plugin>
<groupId>org.eclipse.m2e</groupId>
<artifactId>lifecycle-mapping</artifactId>
<version>1.0.0</version>
<configuration>
<lifecycleMappingMetadata>
<pluginExecutions>
<pluginExecution>
<pluginExecutionFilter>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-plugin-plugin</artifactId>
<versionRange>[3.3,)</versionRange>
<goals>
<goal>descriptor</goal>
</goals>
</pluginExecutionFilter>
<action>
<ignore></ignore>
</action>
</pluginExecution>
</pluginExecutions>
</lifecycleMappingMetadata>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>
</project>

View File

@ -22,15 +22,13 @@ import java.util.Properties;
import org.apache.maven.plugin.AbstractMojo;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugin.MojoFailureException;
import org.apache.maven.plugins.annotations.LifecyclePhase;
import org.apache.maven.plugins.annotations.Mojo;
/**
* Allows a Java Client to be run which must hve a static main(String[] args) method
*/
/**
* @phase verify
* @goal runClient
*/
@Mojo(name = "runClient", defaultPhase = LifecyclePhase.VERIFY)
public class ActiveMQClientPlugin extends AbstractMojo
{

View File

@ -31,13 +31,12 @@ import org.apache.maven.plugin.AbstractMojo;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugin.MojoFailureException;
import org.apache.maven.plugin.descriptor.PluginDescriptor;
import org.apache.maven.plugins.annotations.LifecyclePhase;
import org.apache.maven.plugins.annotations.Mojo;
import org.codehaus.classworlds.ClassRealm;
import org.codehaus.classworlds.ClassWorld;
/**
* @phase verify
* @goal start
*/
@Mojo(name = "start", defaultPhase = LifecyclePhase.VERIFY)
public class ActiveMQStartPlugin extends AbstractMojo
{

View File

@ -16,17 +16,16 @@
*/
package org.apache.activemq.artemis.maven;
import org.apache.maven.plugin.AbstractMojo;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugin.MojoFailureException;
import java.io.File;
import java.io.IOException;
/**
* @phase verify
* @goal stop
*/
import org.apache.maven.plugin.AbstractMojo;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugin.MojoFailureException;
import org.apache.maven.plugins.annotations.LifecyclePhase;
import org.apache.maven.plugins.annotations.Mojo;
@Mojo(name = "stop", defaultPhase = LifecyclePhase.VERIFY)
public class ActiveMQStopPlugin extends AbstractMojo
{

View File

@ -27,11 +27,11 @@ import java.util.Properties;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;
import org.apache.maven.artifact.DefaultArtifact;
import org.apache.maven.artifact.Artifact;
public class SpawnedVMSupport
{
public static Process spawnVM(List<DefaultArtifact> arts,
public static Process spawnVM(List<Artifact> arts,
final String logName,
final String className,
final Properties properties,
@ -71,7 +71,7 @@ public class SpawnedVMSupport
.append(" ");
String pathSeparater = System.getProperty("path.separator");
StringBuilder classpath = new StringBuilder();
for (DefaultArtifact artifact : arts)
for (Artifact artifact : arts)
{
classpath.append(artifact.getFile()
.getAbsolutePath())