You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by hb...@apache.org on 2014/06/01 23:20:31 UTC

svn commit: r1599050 - in /maven/plugin-tools/trunk/maven-plugin-plugin/src: it/help-basic/pom.xml it/help-basic/src/main/java/test/MyMojo.java main/java/org/apache/maven/plugin/plugin/HelpGeneratorMojo.java

Author: hboutemy
Date: Sun Jun  1 21:20:30 2014
New Revision: 1599050

URL: http://svn.apache.org/r1599050
Log:
[MPLUGIN-238] avoid HelpMojo failure when using java-annotations without any configuration

Modified:
    maven/plugin-tools/trunk/maven-plugin-plugin/src/it/help-basic/pom.xml
    maven/plugin-tools/trunk/maven-plugin-plugin/src/it/help-basic/src/main/java/test/MyMojo.java
    maven/plugin-tools/trunk/maven-plugin-plugin/src/main/java/org/apache/maven/plugin/plugin/HelpGeneratorMojo.java

Modified: maven/plugin-tools/trunk/maven-plugin-plugin/src/it/help-basic/pom.xml
URL: http://svn.apache.org/viewvc/maven/plugin-tools/trunk/maven-plugin-plugin/src/it/help-basic/pom.xml?rev=1599050&r1=1599049&r2=1599050&view=diff
==============================================================================
--- maven/plugin-tools/trunk/maven-plugin-plugin/src/it/help-basic/pom.xml (original)
+++ maven/plugin-tools/trunk/maven-plugin-plugin/src/it/help-basic/pom.xml Sun Jun  1 21:20:30 2014
@@ -46,6 +46,12 @@ under the License.
       <artifactId>plexus-utils</artifactId>
       <version>3.0.1</version>
     </dependency>
+    <dependency>
+      <groupId>org.apache.maven.plugin-tools</groupId>
+      <artifactId>maven-plugin-annotations</artifactId>
+      <version>@project.version@</version>
+      <scope>provided</scope>
+    </dependency>
   </dependencies>
 
   <build>
@@ -65,6 +71,10 @@ under the License.
         <version>@project.version@</version>
         <executions>
           <execution>
+            <id>default-descriptor</id>
+            <phase>process-classes</phase>
+          </execution>
+          <execution>
             <id>help-goal</id>
             <goals>
               <goal>helpmojo</goal>

Modified: maven/plugin-tools/trunk/maven-plugin-plugin/src/it/help-basic/src/main/java/test/MyMojo.java
URL: http://svn.apache.org/viewvc/maven/plugin-tools/trunk/maven-plugin-plugin/src/it/help-basic/src/main/java/test/MyMojo.java?rev=1599050&r1=1599049&r2=1599050&view=diff
==============================================================================
--- maven/plugin-tools/trunk/maven-plugin-plugin/src/it/help-basic/src/main/java/test/MyMojo.java (original)
+++ maven/plugin-tools/trunk/maven-plugin-plugin/src/it/help-basic/src/main/java/test/MyMojo.java Sun Jun  1 21:20:30 2014
@@ -20,15 +20,17 @@ package test;
  */
 
 import org.apache.maven.plugin.AbstractMojo;
+import org.apache.maven.plugins.annotations.Mojo;
+import org.apache.maven.plugins.annotations.Parameter;
 
 /**
  * MOJO-DESCRIPTION. Some "quotation" marks and backslashes '\\', some <strong>important</strong> javadoc<br> and an
  * inline link to {@link test.AnotherMojo}.
  * 
- * @goal test
  * @deprecated As of 1.0, use the "quoted" goal instead.
  * @since 2.1
  */
+@Mojo( name= "test" )
 public class MyMojo
     extends AbstractMojo
 {
@@ -37,31 +39,26 @@ public class MyMojo
      * This parameter uses "quotation" marks and backslashes '\\' in its description. Those characters <em>must</em> be
      * escaped in Java string literals.
      * 
-     * @parameter default-value="escape\\backslash"
      * @since 2.0
      */
+    @Parameter( defaultValue = "escape\\backslash" )
     private String defaultParam;
 
     /**
      * This parameter is deprecated.
      * 
-     * @parameter
      * @deprecated As of version 1.0, use the {@link #defaultParam} instead.
      */
+    @Parameter
     private String deprecatedParam;
 
-    /**
-     * @parameter expression="${test.undocumented}"
-     * @required
-     */
+    @Parameter( property = "test.undocumented", required = true )
     private String undocumentedParam;
 
     /**
      * Readonly parameter: should not be proposed for configuration.
-     *
-     * @parameter default-value="not for configuration"
-     * @readonly
      */
+    @Parameter( defaultValue = "not for configuration", readonly = true )
     private String readonly;
 
     public void execute()

Modified: maven/plugin-tools/trunk/maven-plugin-plugin/src/main/java/org/apache/maven/plugin/plugin/HelpGeneratorMojo.java
URL: http://svn.apache.org/viewvc/maven/plugin-tools/trunk/maven-plugin-plugin/src/main/java/org/apache/maven/plugin/plugin/HelpGeneratorMojo.java?rev=1599050&r1=1599049&r2=1599050&view=diff
==============================================================================
--- maven/plugin-tools/trunk/maven-plugin-plugin/src/main/java/org/apache/maven/plugin/plugin/HelpGeneratorMojo.java (original)
+++ maven/plugin-tools/trunk/maven-plugin-plugin/src/main/java/org/apache/maven/plugin/plugin/HelpGeneratorMojo.java Sun Jun  1 21:20:30 2014
@@ -85,6 +85,9 @@ public class HelpGeneratorMojo
     public void execute()
         throws MojoExecutionException
     {
+        // force value for this plugin
+        skipErrorNoDescriptorsFound = true;
+
         super.execute();
 
         if ( !project.getCompileSourceRoots().contains( outputDirectory.getAbsolutePath() ) && !skip )