diff --git a/maven-plugin-annotations/src/main/java/org/apache/maven/plugins/annotations/Component.java b/maven-plugin-annotations/src/main/java/org/apache/maven/plugins/annotations/Component.java
index e6687b2..ad3aabd 100644
--- a/maven-plugin-annotations/src/main/java/org/apache/maven/plugins/annotations/Component.java
+++ b/maven-plugin-annotations/src/main/java/org/apache/maven/plugins/annotations/Component.java
@@ -27,6 +27,8 @@ import java.lang.annotation.RetentionPolicy;
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 true if the Mojo should fail when the component cannot be injected
+ */
boolean required() default true;
+ /**
+ * ignored...
+ * @return
+ */
boolean readonly() default true;
}
diff --git a/maven-plugin-annotations/src/main/java/org/apache/maven/plugins/annotations/Execute.java b/maven-plugin-annotations/src/main/java/org/apache/maven/plugins/annotations/Execute.java
index bae0f4d..ae41d04 100644
--- a/maven-plugin-annotations/src/main/java/org/apache/maven/plugins/annotations/Execute.java
+++ b/maven-plugin-annotations/src/main/java/org/apache/maven/plugins/annotations/Execute.java
@@ -27,6 +27,8 @@ import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/**
+ * Used if your Mojo need to fork a lifecycle.
+ *
* @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 "";
}
diff --git a/maven-plugin-annotations/src/main/java/org/apache/maven/plugins/annotations/InstanciationStrategy.java b/maven-plugin-annotations/src/main/java/org/apache/maven/plugins/annotations/InstanciationStrategy.java
index a5d65b6..e77254e 100644
--- a/maven-plugin-annotations/src/main/java/org/apache/maven/plugins/annotations/InstanciationStrategy.java
+++ b/maven-plugin-annotations/src/main/java/org/apache/maven/plugins/annotations/InstanciationStrategy.java
@@ -20,6 +20,8 @@ package org.apache.maven.plugins.annotations;
*/
/**
+ * Component instanciation strategy.
+ *
* @author Hervé Boutemy
* @since 3.0
*/
diff --git a/maven-plugin-annotations/src/main/java/org/apache/maven/plugins/annotations/LifecyclePhase.java b/maven-plugin-annotations/src/main/java/org/apache/maven/plugins/annotations/LifecyclePhase.java
index d99f64e..4930ebc 100644
--- a/maven-plugin-annotations/src/main/java/org/apache/maven/plugins/annotations/LifecyclePhase.java
+++ b/maven-plugin-annotations/src/main/java/org/apache/maven/plugins/annotations/LifecyclePhase.java
@@ -20,6 +20,7 @@ package org.apache.maven.plugins.annotations;
*/
/**
+ * Lifecycle phases.
* @author Olivier Lamy
* @since 3.0
*/
diff --git a/maven-plugin-annotations/src/main/java/org/apache/maven/plugins/annotations/Mojo.java b/maven-plugin-annotations/src/main/java/org/apache/maven/plugins/annotations/Mojo.java
index c41ec9a..ff55a71 100644
--- a/maven-plugin-annotations/src/main/java/org/apache/maven/plugins/annotations/Mojo.java
+++ b/maven-plugin-annotations/src/main/java/org/apache/maven/plugins/annotations/Mojo.java
@@ -27,6 +27,8 @@ import java.lang.annotation.RetentionPolicy;
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 per-lookup and singleton are supported)
+ * @return the instantiation strategy
+ */
InstanciationStrategy instantiationStrategy() default InstanciationStrategy.PER_LOOKUP;
+ /**
+ * execution strategy: once-per-session or always.
+ * @return once-per-session or always
+ */
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;
}
diff --git a/maven-plugin-annotations/src/main/java/org/apache/maven/plugins/annotations/Parameter.java b/maven-plugin-annotations/src/main/java/org/apache/maven/plugins/annotations/Parameter.java
index b9da288..d08cfbd 100644
--- a/maven-plugin-annotations/src/main/java/org/apache/maven/plugins/annotations/Parameter.java
+++ b/maven-plugin-annotations/src/main/java/org/apache/maven/plugins/annotations/Parameter.java
@@ -27,6 +27,8 @@ import java.lang.annotation.RetentionPolicy;
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 -D execution, setting properties or pom properties.
+ * @return property name
+ */
String expression() default "";
+ /**
+ * parameter default value, eventually containing ${...} expressions which will be interpreted at inject time.
+ * @return the default value
+ */
String defaultValue() default "";
+ /**
+ * is the parameter required?
+ * @return true if the Mojo should fail when the parameter cannot be injected
+ */
boolean required() default false;
+ /**
+ * ignored...
+ * @return
+ */
boolean readonly() default false;
}