[MDOCCK-25] use maven-plugin-tools' java 5 annotations
git-svn-id: https://svn.apache.org/repos/asf/maven/plugins/trunk@1360291 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/pom.xml b/pom.xml
index 1c680ec..9d2f39a 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>
@@ -81,6 +81,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>commons-httpclient</groupId>
<artifactId>commons-httpclient</artifactId>
<version>3.1</version>
@@ -126,6 +131,38 @@
</dependency>
</dependencies>
+ <build>
+ <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>
+ </plugin>
+ </plugins>
+ </pluginManagement>
+ <plugins>
+ <plugin>
+ <artifactId>maven-plugin-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>generate-descriptor</id>
+ <goals>
+ <goal>descriptor</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+
<profiles>
<profile>
<id>run-its</id>
diff --git a/src/main/java/org/apache/maven/plugin/docck/AbstractCheckDocumentationMojo.java b/src/main/java/org/apache/maven/plugin/docck/AbstractCheckDocumentationMojo.java
index c35c2dd..8ea6774 100644
--- a/src/main/java/org/apache/maven/plugin/docck/AbstractCheckDocumentationMojo.java
+++ b/src/main/java/org/apache/maven/plugin/docck/AbstractCheckDocumentationMojo.java
@@ -36,6 +36,8 @@
import org.apache.maven.plugin.MojoFailureException;
import org.apache.maven.plugin.docck.reports.DocumentationReport;
import org.apache.maven.plugin.docck.reports.DocumentationReporter;
+import org.apache.maven.plugins.annotations.Component;
+import org.apache.maven.plugins.annotations.Parameter;
import org.apache.maven.project.MavenProject;
import org.apache.maven.settings.Proxy;
import org.apache.maven.settings.Settings;
@@ -60,7 +62,6 @@
* reused for other types of projects, too.
*
* @author jdcasey
- * @threadSafe
*/
public abstract class AbstractCheckDocumentationMojo
extends AbstractMojo
@@ -68,43 +69,36 @@
private static final int HTTP_STATUS_200 = 200;
/**
- * @parameter default-value="${reactorProjects}"
- * @readonly
- * @required
*/
+ @Parameter( property = "reactorProjects", readonly = true, required = true )
private List reactorProjects;
/**
* An optional location where the results will be written to. If this is
* not specified the results will be written to the console.
- *
- * @parameter expression="${output}"
*/
+ @Parameter( property = "output" )
private File output;
/**
* Directory where the site source for the project is located.
*
- * @parameter expression="${siteDirectory}" default-value="src/site"
* @todo should be determined programmatically
*/
+ @Parameter( property = "siteDirectory", defaultValue = "src/site" )
protected String siteDirectory;
/**
* Sets whether this plugin is running in offline or online mode. Also
* useful when you don't want to verify http URLs.
- *
- * @parameter expression="${settings.offline}"
*/
+ @Parameter( property = "settings.offline" )
private boolean offline;
/**
* The current user system settings for use in Maven.
- *
- * @parameter expression="${settings}"
- * @required
- * @readonly
*/
+ @Component
private Settings settings;
private HttpClient httpClient;
diff --git a/src/main/java/org/apache/maven/plugin/docck/CheckPluginDocumentationMojo.java b/src/main/java/org/apache/maven/plugin/docck/CheckPluginDocumentationMojo.java
index 1fc90d4..c316d38 100644
--- a/src/main/java/org/apache/maven/plugin/docck/CheckPluginDocumentationMojo.java
+++ b/src/main/java/org/apache/maven/plugin/docck/CheckPluginDocumentationMojo.java
@@ -25,6 +25,9 @@
import org.apache.maven.plugin.descriptor.Parameter;
import org.apache.maven.plugin.descriptor.PluginDescriptor;
import org.apache.maven.plugin.docck.reports.DocumentationReporter;
+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.project.MavenProject;
import org.apache.maven.tools.plugin.extractor.ExtractionException;
import org.apache.maven.tools.plugin.scanner.MojoScanner;
@@ -42,20 +45,16 @@
* Checks a plugin's documentation for the standard minimums.
*
* @author jdcasey
- * @goal check
- * @aggregator
- * @phase validate
- * @threadSafe
*/
+@Mojo( name = "check", aggregator = true, defaultPhase = LifecyclePhase.VALIDATE, threadSafe = true )
public class CheckPluginDocumentationMojo
extends AbstractCheckDocumentationMojo
{
/**
* Plexus component that searches for Mojos.
- *
- * @component
*/
+ @Component
protected MojoScanner mojoScanner;
// TODO: really a description of length 1 isn't all that helpful...