You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by tc...@apache.org on 2012/07/11 18:50:39 UTC

svn commit: r1360291 - in /maven/plugins/trunk/maven-docck-plugin: pom.xml src/main/java/org/apache/maven/plugin/docck/AbstractCheckDocumentationMojo.java src/main/java/org/apache/maven/plugin/docck/CheckPluginDocumentationMojo.java

Author: tchemit
Date: Wed Jul 11 16:50:39 2012
New Revision: 1360291

URL: http://svn.apache.org/viewvc?rev=1360291&view=rev
Log:
[MDOCCK-25] use maven-plugin-tools' java 5 annotations

Modified:
    maven/plugins/trunk/maven-docck-plugin/pom.xml
    maven/plugins/trunk/maven-docck-plugin/src/main/java/org/apache/maven/plugin/docck/AbstractCheckDocumentationMojo.java
    maven/plugins/trunk/maven-docck-plugin/src/main/java/org/apache/maven/plugin/docck/CheckPluginDocumentationMojo.java

Modified: maven/plugins/trunk/maven-docck-plugin/pom.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-docck-plugin/pom.xml?rev=1360291&r1=1360290&r2=1360291&view=diff
==============================================================================
--- maven/plugins/trunk/maven-docck-plugin/pom.xml (original)
+++ maven/plugins/trunk/maven-docck-plugin/pom.xml Wed Jul 11 16:50:39 2012
@@ -25,7 +25,7 @@ under the License.
   <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 @@ under the License.
       <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 @@ under the License.
     </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>

Modified: maven/plugins/trunk/maven-docck-plugin/src/main/java/org/apache/maven/plugin/docck/AbstractCheckDocumentationMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-docck-plugin/src/main/java/org/apache/maven/plugin/docck/AbstractCheckDocumentationMojo.java?rev=1360291&r1=1360290&r2=1360291&view=diff
==============================================================================
--- maven/plugins/trunk/maven-docck-plugin/src/main/java/org/apache/maven/plugin/docck/AbstractCheckDocumentationMojo.java (original)
+++ maven/plugins/trunk/maven-docck-plugin/src/main/java/org/apache/maven/plugin/docck/AbstractCheckDocumentationMojo.java Wed Jul 11 16:50:39 2012
@@ -36,6 +36,8 @@ import org.apache.maven.plugin.MojoExecu
 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 @@ import java.util.Map;
  * reused for other types of projects, too.
  *
  * @author jdcasey
- * @threadSafe
  */
 public abstract class AbstractCheckDocumentationMojo
     extends AbstractMojo
@@ -68,43 +69,36 @@ public abstract class AbstractCheckDocum
     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;

Modified: maven/plugins/trunk/maven-docck-plugin/src/main/java/org/apache/maven/plugin/docck/CheckPluginDocumentationMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-docck-plugin/src/main/java/org/apache/maven/plugin/docck/CheckPluginDocumentationMojo.java?rev=1360291&r1=1360290&r2=1360291&view=diff
==============================================================================
--- maven/plugins/trunk/maven-docck-plugin/src/main/java/org/apache/maven/plugin/docck/CheckPluginDocumentationMojo.java (original)
+++ maven/plugins/trunk/maven-docck-plugin/src/main/java/org/apache/maven/plugin/docck/CheckPluginDocumentationMojo.java Wed Jul 11 16:50:39 2012
@@ -25,6 +25,9 @@ import org.apache.maven.plugin.descripto
 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 @@ import java.util.List;
  * 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...