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 2012/05/14 23:11:16 UTC
svn commit: r1338427 - in
/maven/plugin-tools/trunk/maven-plugin-annotations/src/main/java/org/apache/maven/plugins/annotations:
Component.java Execute.java InstanciationStrategy.java LifecyclePhase.java
Mojo.java Parameter.java
Author: hboutemy
Date: Mon May 14 21:11:15 2012
New Revision: 1338427
URL: http://svn.apache.org/viewvc?rev=1338427&view=rev
Log:
added javadoc
Modified:
maven/plugin-tools/trunk/maven-plugin-annotations/src/main/java/org/apache/maven/plugins/annotations/Component.java
maven/plugin-tools/trunk/maven-plugin-annotations/src/main/java/org/apache/maven/plugins/annotations/Execute.java
maven/plugin-tools/trunk/maven-plugin-annotations/src/main/java/org/apache/maven/plugins/annotations/InstanciationStrategy.java
maven/plugin-tools/trunk/maven-plugin-annotations/src/main/java/org/apache/maven/plugins/annotations/LifecyclePhase.java
maven/plugin-tools/trunk/maven-plugin-annotations/src/main/java/org/apache/maven/plugins/annotations/Mojo.java
maven/plugin-tools/trunk/maven-plugin-annotations/src/main/java/org/apache/maven/plugins/annotations/Parameter.java
Modified: maven/plugin-tools/trunk/maven-plugin-annotations/src/main/java/org/apache/maven/plugins/annotations/Component.java
URL: http://svn.apache.org/viewvc/maven/plugin-tools/trunk/maven-plugin-annotations/src/main/java/org/apache/maven/plugins/annotations/Component.java?rev=1338427&r1=1338426&r2=1338427&view=diff
==============================================================================
--- maven/plugin-tools/trunk/maven-plugin-annotations/src/main/java/org/apache/maven/plugins/annotations/Component.java (original)
+++ maven/plugin-tools/trunk/maven-plugin-annotations/src/main/java/org/apache/maven/plugins/annotations/Component.java Mon May 14 21:11:15 2012
@@ -27,6 +27,8 @@ import java.lang.annotation.RetentionPol
import java.lang.annotation.Target;
/**
+ * Used to configure injection of Plexus components.
+ *
* @author Olivier Lamy
* @since 3.0
*/
@@ -36,11 +38,27 @@ import java.lang.annotation.Target;
@Inherited
public @interface Component
{
+ /**
+ * role of the component to inject.
+ * @return the role
+ */
String role() default "";
+ /**
+ * role-hint of the component to inject.
+ * @return the role-hint
+ */
String roleHint() default "";
+ /**
+ * is the component required?
+ * @return <code>true</code> if the Mojo should fail when the component cannot be injected
+ */
boolean required() default true;
+ /**
+ * ignored...
+ * @return
+ */
boolean readonly() default true;
}
Modified: maven/plugin-tools/trunk/maven-plugin-annotations/src/main/java/org/apache/maven/plugins/annotations/Execute.java
URL: http://svn.apache.org/viewvc/maven/plugin-tools/trunk/maven-plugin-annotations/src/main/java/org/apache/maven/plugins/annotations/Execute.java?rev=1338427&r1=1338426&r2=1338427&view=diff
==============================================================================
--- maven/plugin-tools/trunk/maven-plugin-annotations/src/main/java/org/apache/maven/plugins/annotations/Execute.java (original)
+++ maven/plugin-tools/trunk/maven-plugin-annotations/src/main/java/org/apache/maven/plugins/annotations/Execute.java Mon May 14 21:11:15 2012
@@ -27,6 +27,8 @@ import java.lang.annotation.RetentionPol
import java.lang.annotation.Target;
/**
+ * Used if your Mojo need to fork a <a href="/ref/3.0.4/maven-core/lifecycles.html">lifecycle</a>.
+ *
* @author Olivier Lamy
* @since 3.0
*/
@@ -36,9 +38,21 @@ import java.lang.annotation.Target;
@Inherited
public @interface Execute
{
+ /**
+ * lifecycle phase to fork.
+ * @return the phase
+ */
LifecyclePhase phase() default LifecyclePhase.NONE;
+ /**
+ * goal to fork.
+ * @return the goal
+ */
String goal() default "";
+ /**
+ * lifecycle id to fork.
+ * @return the lifecycle id
+ */
String lifecycle() default "";
}
Modified: maven/plugin-tools/trunk/maven-plugin-annotations/src/main/java/org/apache/maven/plugins/annotations/InstanciationStrategy.java
URL: http://svn.apache.org/viewvc/maven/plugin-tools/trunk/maven-plugin-annotations/src/main/java/org/apache/maven/plugins/annotations/InstanciationStrategy.java?rev=1338427&r1=1338426&r2=1338427&view=diff
==============================================================================
--- maven/plugin-tools/trunk/maven-plugin-annotations/src/main/java/org/apache/maven/plugins/annotations/InstanciationStrategy.java (original)
+++ maven/plugin-tools/trunk/maven-plugin-annotations/src/main/java/org/apache/maven/plugins/annotations/InstanciationStrategy.java Mon May 14 21:11:15 2012
@@ -20,6 +20,8 @@ package org.apache.maven.plugins.annotat
*/
/**
+ * Component instanciation strategy.
+ *
* @author Hervé Boutemy
* @since 3.0
*/
Modified: maven/plugin-tools/trunk/maven-plugin-annotations/src/main/java/org/apache/maven/plugins/annotations/LifecyclePhase.java
URL: http://svn.apache.org/viewvc/maven/plugin-tools/trunk/maven-plugin-annotations/src/main/java/org/apache/maven/plugins/annotations/LifecyclePhase.java?rev=1338427&r1=1338426&r2=1338427&view=diff
==============================================================================
--- maven/plugin-tools/trunk/maven-plugin-annotations/src/main/java/org/apache/maven/plugins/annotations/LifecyclePhase.java (original)
+++ maven/plugin-tools/trunk/maven-plugin-annotations/src/main/java/org/apache/maven/plugins/annotations/LifecyclePhase.java Mon May 14 21:11:15 2012
@@ -20,6 +20,7 @@ package org.apache.maven.plugins.annotat
*/
/**
+ * <a href="/ref/3.0.4/maven-core/lifecycles.html">Lifecycle phases</a>.
* @author Olivier Lamy
* @since 3.0
*/
Modified: maven/plugin-tools/trunk/maven-plugin-annotations/src/main/java/org/apache/maven/plugins/annotations/Mojo.java
URL: http://svn.apache.org/viewvc/maven/plugin-tools/trunk/maven-plugin-annotations/src/main/java/org/apache/maven/plugins/annotations/Mojo.java?rev=1338427&r1=1338426&r2=1338427&view=diff
==============================================================================
--- maven/plugin-tools/trunk/maven-plugin-annotations/src/main/java/org/apache/maven/plugins/annotations/Mojo.java (original)
+++ maven/plugin-tools/trunk/maven-plugin-annotations/src/main/java/org/apache/maven/plugins/annotations/Mojo.java Mon May 14 21:11:15 2012
@@ -27,6 +27,8 @@ import java.lang.annotation.RetentionPol
import java.lang.annotation.Target;
/**
+ * This annotation will mark your class as a Mojo (ie. goal in a Maven plugin).
+ *
* @author Olivier Lamy
* @since 3.0
*/
@@ -36,31 +38,83 @@ import java.lang.annotation.Target;
@Inherited
public @interface Mojo
{
+ /**
+ * goal name (required).
+ * @return the goal name
+ */
String name();
+ /**
+ * default phase to bind your mojo.
+ * @return the default phase
+ */
LifecyclePhase defaultPhase() default LifecyclePhase.NONE;
+ /**
+ * the required dependency resolution scope.
+ * @return
+ */
ResolutionScope requiresDependencyResolution() default ResolutionScope.RUNTIME;
+ /**
+ * the required dependency collection scope.
+ * @return
+ */
ResolutionScope requiresDependencyCollection() default ResolutionScope.RUNTIME;
+ /**
+ * your Mojo instantiation strategy. (Only <code>per-lookup</code> and <code>singleton</code> are supported)
+ * @return the instantiation strategy
+ */
InstanciationStrategy instantiationStrategy() default InstanciationStrategy.PER_LOOKUP;
+ /**
+ * execution strategy: <code>once-per-session</code> or <code>always</code>.
+ * @return <code>once-per-session</code> or <code>always</code>
+ */
String executionStrategy() default "once-per-session";
+ /**
+ * does your mojo requires a project to be executed?
+ * @return
+ */
boolean requiresProject() default true;
+ /**
+ * does your mojo requires a reporting context to be executed?
+ * @return
+ */
boolean requiresReports() default false;
+ /**
+ * if the Mojo uses the Maven project and its child modules.
+ * @return
+ */
boolean aggregator() default false;
+ /**
+ * can this Mojo be invoked directly only?
+ * @return
+ */
boolean requiresDirectInvocation() default false;
+ /**
+ * does this Mojo need to be online to be executed?
+ * @return
+ */
boolean requiresOnline() default false;
boolean inheritByDefault() default true;
+ /**
+ * own configurator class.
+ * @return
+ */
String configurator() default "";
+ /**
+ * is your mojo thread safe (since Maven 3.x)?
+ * @return
+ */
boolean threadSafe() default false;
}
Modified: maven/plugin-tools/trunk/maven-plugin-annotations/src/main/java/org/apache/maven/plugins/annotations/Parameter.java
URL: http://svn.apache.org/viewvc/maven/plugin-tools/trunk/maven-plugin-annotations/src/main/java/org/apache/maven/plugins/annotations/Parameter.java?rev=1338427&r1=1338426&r2=1338427&view=diff
==============================================================================
--- maven/plugin-tools/trunk/maven-plugin-annotations/src/main/java/org/apache/maven/plugins/annotations/Parameter.java (original)
+++ maven/plugin-tools/trunk/maven-plugin-annotations/src/main/java/org/apache/maven/plugins/annotations/Parameter.java Mon May 14 21:11:15 2012
@@ -27,6 +27,8 @@ import java.lang.annotation.RetentionPol
import java.lang.annotation.Target;
/**
+ * Used to configure your Mojo Parameters.
+ *
* @author Olivier Lamy
* @since 3.0
*/
@@ -36,13 +38,33 @@ import java.lang.annotation.Target;
@Inherited
public @interface Parameter
{
+ /**
+ * alias supported to get parameter value.
+ * @return the alias
+ */
String alias() default "";
+ /**
+ * Property to use to retrieve a value. Can come from <code>-D</code> execution, setting properties or pom properties.
+ * @return property name
+ */
String expression() default "";
+ /**
+ * parameter default value, eventually containing <code>${...}</code> expressions which will be interpreted at inject time.
+ * @return the default value
+ */
String defaultValue() default "";
+ /**
+ * is the parameter required?
+ * @return <code>true</code> if the Mojo should fail when the parameter cannot be injected
+ */
boolean required() default false;
+ /**
+ * ignored...
+ * @return
+ */
boolean readonly() default false;
}