added javadoc

git-svn-id: https://svn.apache.org/repos/asf/maven/plugin-tools/trunk@1338427 13f79535-47bb-0310-9956-ffa450edef68
master
Herve Boutemy 2012-05-14 21:11:15 +00:00
parent d56e6cba11
commit 1905753a7e
6 changed files with 111 additions and 0 deletions

View File

@ -27,6 +27,8 @@ import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target; import java.lang.annotation.Target;
/** /**
* Used to configure injection of Plexus components.
*
* @author Olivier Lamy * @author Olivier Lamy
* @since 3.0 * @since 3.0
*/ */
@ -36,11 +38,27 @@ import java.lang.annotation.Target;
@Inherited @Inherited
public @interface Component public @interface Component
{ {
/**
* role of the component to inject.
* @return the role
*/
String role() default ""; String role() default "";
/**
* role-hint of the component to inject.
* @return the role-hint
*/
String roleHint() default ""; 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; boolean required() default true;
/**
* ignored...
* @return
*/
boolean readonly() default true; boolean readonly() default true;
} }

View File

@ -27,6 +27,8 @@ import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target; 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 * @author Olivier Lamy
* @since 3.0 * @since 3.0
*/ */
@ -36,9 +38,21 @@ import java.lang.annotation.Target;
@Inherited @Inherited
public @interface Execute public @interface Execute
{ {
/**
* lifecycle phase to fork.
* @return the phase
*/
LifecyclePhase phase() default LifecyclePhase.NONE; LifecyclePhase phase() default LifecyclePhase.NONE;
/**
* goal to fork.
* @return the goal
*/
String goal() default ""; String goal() default "";
/**
* lifecycle id to fork.
* @return the lifecycle id
*/
String lifecycle() default ""; String lifecycle() default "";
} }

View File

@ -20,6 +20,8 @@ package org.apache.maven.plugins.annotations;
*/ */
/** /**
* Component instanciation strategy.
*
* @author Hervé Boutemy * @author Hervé Boutemy
* @since 3.0 * @since 3.0
*/ */

View File

@ -20,6 +20,7 @@ package org.apache.maven.plugins.annotations;
*/ */
/** /**
* <a href="/ref/3.0.4/maven-core/lifecycles.html">Lifecycle phases</a>.
* @author Olivier Lamy * @author Olivier Lamy
* @since 3.0 * @since 3.0
*/ */

View File

@ -27,6 +27,8 @@ import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target; import java.lang.annotation.Target;
/** /**
* This annotation will mark your class as a Mojo (ie. goal in a Maven plugin).
*
* @author Olivier Lamy * @author Olivier Lamy
* @since 3.0 * @since 3.0
*/ */
@ -36,31 +38,83 @@ import java.lang.annotation.Target;
@Inherited @Inherited
public @interface Mojo public @interface Mojo
{ {
/**
* goal name (required).
* @return the goal name
*/
String name(); String name();
/**
* default phase to bind your mojo.
* @return the default phase
*/
LifecyclePhase defaultPhase() default LifecyclePhase.NONE; LifecyclePhase defaultPhase() default LifecyclePhase.NONE;
/**
* the required dependency resolution scope.
* @return
*/
ResolutionScope requiresDependencyResolution() default ResolutionScope.RUNTIME; ResolutionScope requiresDependencyResolution() default ResolutionScope.RUNTIME;
/**
* the required dependency collection scope.
* @return
*/
ResolutionScope requiresDependencyCollection() default ResolutionScope.RUNTIME; 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; 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"; String executionStrategy() default "once-per-session";
/**
* does your mojo requires a project to be executed?
* @return
*/
boolean requiresProject() default true; boolean requiresProject() default true;
/**
* does your mojo requires a reporting context to be executed?
* @return
*/
boolean requiresReports() default false; boolean requiresReports() default false;
/**
* if the Mojo uses the Maven project and its child modules.
* @return
*/
boolean aggregator() default false; boolean aggregator() default false;
/**
* can this Mojo be invoked directly only?
* @return
*/
boolean requiresDirectInvocation() default false; boolean requiresDirectInvocation() default false;
/**
* does this Mojo need to be online to be executed?
* @return
*/
boolean requiresOnline() default false; boolean requiresOnline() default false;
boolean inheritByDefault() default true; boolean inheritByDefault() default true;
/**
* own configurator class.
* @return
*/
String configurator() default ""; String configurator() default "";
/**
* is your mojo thread safe (since Maven 3.x)?
* @return
*/
boolean threadSafe() default false; boolean threadSafe() default false;
} }

View File

@ -27,6 +27,8 @@ import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target; import java.lang.annotation.Target;
/** /**
* Used to configure your Mojo Parameters.
*
* @author Olivier Lamy * @author Olivier Lamy
* @since 3.0 * @since 3.0
*/ */
@ -36,13 +38,33 @@ import java.lang.annotation.Target;
@Inherited @Inherited
public @interface Parameter public @interface Parameter
{ {
/**
* alias supported to get parameter value.
* @return the alias
*/
String alias() default ""; 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 ""; 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 ""; 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; boolean required() default false;
/**
* ignored...
* @return
*/
boolean readonly() default false; boolean readonly() default false;
} }