From acc04dca1b6a7ef39f41d976dcc8eb96aa0aa53f Mon Sep 17 00:00:00 2001 From: Herve Boutemy Date: Thu, 17 May 2012 15:30:56 +0000 Subject: [PATCH] fixed discrepency between plugin.mdo (which is pure documentation) and corresponding hand-written code git-svn-id: https://svn.apache.org/repos/asf/maven/maven-3/trunk@1339651 13f79535-47bb-0310-9956-ffa450edef68 --- .../plugin/descriptor/MojoDescriptor.java | 40 +++++++++++++------ maven-plugin-api/src/main/mdo/plugin.mdo | 36 ++++++++++------- 2 files changed, 50 insertions(+), 26 deletions(-) diff --git a/maven-plugin-api/src/main/java/org/apache/maven/plugin/descriptor/MojoDescriptor.java b/maven-plugin-api/src/main/java/org/apache/maven/plugin/descriptor/MojoDescriptor.java index 31ff57b276..d73f66d5f4 100644 --- a/maven-plugin-api/src/main/java/org/apache/maven/plugin/descriptor/MojoDescriptor.java +++ b/maven-plugin-api/src/main/java/org/apache/maven/plugin/descriptor/MojoDescriptor.java @@ -63,28 +63,42 @@ public class MojoDescriptor /** By default, the execution strategy is "once-per-session" */ private String executionStrategy = SINGLE_PASS_EXEC_STRATEGY; - /** The goal name of the Mojo */ + /** + * The goal name for the Mojo, that users will reference from the command line to execute the Mojo directly, or + * inside a POM in order to provide Mojo-specific configuration. + */ private String goal; - /** Reference the binded phase name of the Mojo */ + /** + * Defines a default phase to bind a mojo execution to if the user does not explicitly set a phase in the POM. + * Note: This will not automagically make a mojo run when the plugin declaration is added to the POM. It + * merely enables the user to omit the <phase> element from the surrounding + * <execution> element. + */ private String phase; /** Specify the version when the Mojo was added to the API. Similar to Javadoc since. */ private String since; - /** Reference the invocation phase of the Mojo */ + /** Reference the invocation phase of the Mojo. */ private String executePhase; - /** Reference the invocation goal of the Mojo */ + /** Reference the invocation goal of the Mojo. */ private String executeGoal; - /** Reference the invocation lifecycle of the Mojo */ + /** Reference the invocation lifecycle of the Mojo. */ private String executeLifecycle; - /** Specify the version when the Mojo was deprecated to the API. Similar to Javadoc deprecated. */ + /** + * Specify the version when the Mojo was deprecated to the API. Similar to Javadoc deprecated. This will trigger a + * warning when a user tries to configure a parameter marked as deprecated. + */ private String deprecated; - /** By default, no need to aggregate the Maven project and its child modules */ + /** + * Flags this Mojo to run it in a multi module way, i.e. aggregate the build with the set of projects listed as + * modules. By default, no need to aggregate the Maven project and its child modules + */ private boolean aggregator = false; // ---------------------------------------------------------------------- @@ -112,7 +126,7 @@ public class MojoDescriptor /** By default, the Mojo is inherited */ private boolean inheritedByDefault = true; - /** By default, the Mojo could not be invoke directly */ + /** By default, the Mojo cannot be invoked directly */ private boolean directInvocationOnly = false; /** By default, the Mojo don't need reports to run */ @@ -265,8 +279,10 @@ public class MojoDescriptor /** * Gets the scope of (transitive) dependencies that should be collected. Dependency collection refers to the process * of calculating the complete dependency tree in terms of artifact coordinates. In contrast to dependency - * resolution, this does not include the download of the files for the dependency artifacts. - * + * resolution, this does not include the download of the files for the dependency artifacts. It is meant for mojos + * that only want to analyze the set of transitive dependencies, in particular during early lifecycle phases where + * full dependency resolution might fail due to projects which haven't been built yet. + * * @return The scope of (transitive) dependencies that should be collected or {@code null} if none. */ public String getDependencyCollectionRequired() @@ -597,7 +613,7 @@ public class MojoDescriptor } /** - * @return true if the Mojo could not be invoke directly, false otherwise. + * @return true if the Mojo cannot be invoked directly, false otherwise. */ public boolean isDirectInvocationOnly() { @@ -605,7 +621,7 @@ public class MojoDescriptor } /** - * @param directInvocationOnly true if the Mojo could not be invoke directly, + * @param directInvocationOnly true if the Mojo cannot be invoked directly, * false otherwise. */ public void setDirectInvocationOnly( boolean directInvocationOnly ) diff --git a/maven-plugin-api/src/main/mdo/plugin.mdo b/maven-plugin-api/src/main/mdo/plugin.mdo index 764955777a..43ed54ebaf 100644 --- a/maven-plugin-api/src/main/mdo/plugin.mdo +++ b/maven-plugin-api/src/main/mdo/plugin.mdo @@ -41,6 +41,7 @@ under the License. PluginDescriptor 1.0.0 plugin.xml file.]]> + description @@ -116,6 +117,7 @@ under the License. + goal @@ -123,7 +125,7 @@ under the License. 1.0.0 String - The name for the Mojo that users will reference from the command line to execute the Mojo directly, + The goal name for the Mojo, that users will reference from the command line to execute the Mojo directly, or inside a POM in order to provide Mojo-specific configuration. @@ -146,7 +148,7 @@ under the License. 1.0.0 String java - The implementation language for this Mojo (Java, beanshell, etc.). + The implementation language for this Mojo (java, beanshell, etc.). phase @@ -154,7 +156,7 @@ under the License. String Note: This annotation will not automagically make a mojo run when the plugin declaration is added + Note: This will not automagically make a mojo run when the plugin declaration is added to the POM. It merely enables the user to omit the <phase> element from the surrounding <execution> element. ]]> @@ -163,13 +165,13 @@ under the License. executePhase 1.0.0 String - + Reference the invocation phase of the Mojo. executeGoal 1.0.0 String - + Reference the invocation goal of the Mojo. executeLifecycle @@ -185,7 +187,7 @@ under the License. compile, runtime, test, - compile+runtime (since Maven 3.0) + compile+runtime (since Maven 3.0) or runtime+system (since Maven 3.0) ]]> @@ -205,21 +207,21 @@ under the License. requiresDirectInvocation 1.0.0 boolean - Flags this Mojo to be invoked directly. + Flags this Mojo to be invoked directly only. false requiresProject 1.0.0 boolean - Flags this Mojo to run inside of a project. + Flags this Mojo to require running inside of a project. true requiresReports 1.0.0 boolean - Flags this Mojo to require reports. Unsupported since Maven 3.0. + Flags this Mojo to require running inside of a reports context. Unsupported since Maven 3.0. false @@ -237,6 +239,7 @@ under the License. Flags this Mojo to run it in a multi module way, i.e. aggregate the build with the set of projects listed as modules. + false inheritedByDefault @@ -254,6 +257,7 @@ under the License. builds. Mojos without this annotation will make Maven output a warning when used during a parallel build session. Since Maven 3.0. + false instantiationStrategy @@ -269,6 +273,7 @@ under the License. once-per-session, always. ]]> + once-per-session since @@ -335,6 +340,7 @@ under the License. Parameter 1.0.0 A phase mapping definition. + name @@ -342,7 +348,7 @@ under the License. String true - The name of the parameter, to be used in configuring this parameter from the Mojo's declared defaults + The name of the parameter, to be used while configuring this parameter from the Mojo's declared defaults or from the POM. @@ -424,13 +430,14 @@ under the License. Configuration 1.0.0 A parameter configuration. + expression true 1.0.0 String - Parameter expression. + Parameter expression, to let user override default value with a system property, pom property or settings property. implementation @@ -442,7 +449,7 @@ under the License. defaultValue 1.0.0 String - + The default value, as an expression that will be evaluated at injection or run-time. @@ -450,7 +457,8 @@ under the License. Requirement 1.0.0 - + Describes a component requirement. + role @@ -470,7 +478,7 @@ under the License. true 1.0.0 String - + The field name which has this requirement.