You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by be...@apache.org on 2010/05/01 15:35:33 UTC

svn commit: r940010 - /maven/plugin-tools/trunk/maven-plugin-plugin/src/main/java/org/apache/maven/plugin/plugin/DescriptorGeneratorMojo.java

Author: bentmann
Date: Sat May  1 13:35:33 2010
New Revision: 940010

URL: http://svn.apache.org/viewvc?rev=940010&view=rev
Log:
[MPLUGIN-146] Implement pluginXml parameter for maven-plugin-plugin

o Added a skip parameter instead which simply allows usage of src/main/resources/META-INF/maven/plugin.xml to yield the desired effect

Modified:
    maven/plugin-tools/trunk/maven-plugin-plugin/src/main/java/org/apache/maven/plugin/plugin/DescriptorGeneratorMojo.java

Modified: maven/plugin-tools/trunk/maven-plugin-plugin/src/main/java/org/apache/maven/plugin/plugin/DescriptorGeneratorMojo.java
URL: http://svn.apache.org/viewvc/maven/plugin-tools/trunk/maven-plugin-plugin/src/main/java/org/apache/maven/plugin/plugin/DescriptorGeneratorMojo.java?rev=940010&r1=940009&r2=940010&view=diff
==============================================================================
--- maven/plugin-tools/trunk/maven-plugin-plugin/src/main/java/org/apache/maven/plugin/plugin/DescriptorGeneratorMojo.java (original)
+++ maven/plugin-tools/trunk/maven-plugin-plugin/src/main/java/org/apache/maven/plugin/plugin/DescriptorGeneratorMojo.java Sat May  1 13:35:33 2010
@@ -19,6 +19,7 @@ package org.apache.maven.plugin.plugin;
  * under the License.
  */
 
+import org.apache.maven.plugin.MojoExecutionException;
 import org.apache.maven.tools.plugin.generator.Generator;
 import org.apache.maven.tools.plugin.generator.PluginDescriptorGenerator;
 
@@ -46,6 +47,14 @@ public class DescriptorGeneratorMojo
      */
     protected File outputDirectory;
 
+    /**
+     * A flag to disable generation of the <code>plugin.xml</code> in favor of a hand authored plugin descriptor.
+     * 
+     * @parameter default-value="false"
+     * @since 2.6
+     */
+    private boolean skipDescriptor;
+
     /** {@inheritDoc} */
     protected File getOutputDirectory()
     {
@@ -57,4 +66,17 @@ public class DescriptorGeneratorMojo
     {
         return new PluginDescriptorGenerator();
     }
+
+    /** {@inheritDoc} */
+    public void execute()
+        throws MojoExecutionException
+    {
+        if ( skipDescriptor )
+        {
+            return;
+        }
+
+        super.execute();
+    }
+
 }