o moved all Mojo annotations in an interface

o deprecates old constants

git-svn-id: https://svn.apache.org/repos/asf/maven/plugin-tools/trunk@631836 13f79535-47bb-0310-9956-ffa450edef68
master
Vincent Siveton 2008-02-28 03:58:32 +00:00
parent 65d8620ee9
commit 2face9fe54
2 changed files with 434 additions and 103 deletions

View File

@ -0,0 +1,340 @@
package org.apache.maven.tools.plugin.extractor.java;
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
/**
* List all Javadoc annotations used to describe a Mojo.
*
* @author <a href="mailto:vincent.siveton@gmail.com">Vincent Siveton</a>
* @version $Id$
* @since 2.4
*/
public interface JavaMojoAnnotation
{
// ----------------------------------------------------------------------
// Descriptor for type i.e. Mojo
// ----------------------------------------------------------------------
/**
* Flags this Mojo to run it in a multi module way, i.e. aggregate the build with the set of projects listed
* as modules.
* <br/>
* Refer to <code>&#64;aggregator</code>.
* <br/>
* <b>Note</b>: Should be defined in a Mojo Type.
*/
String AGGREGATOR = "aggregator";
/**
* The configurator type to use when injecting parameter values into this Mojo. The value is normally deduced
* from the Mojo's implementation language, but can be specified to allow a custom ComponentConfigurator
* implementation to be used.
* <br/>
* Refer to <code>&#64;configurator &lt;roleHint&gt;</code>.
* <br/>
* <b>Note</b>: Should be defined in a Mojo Type.
*/
String CONFIGURATOR = "configurator";
/**
* The description for the Mojo.
* <br/>
* Refer to <code>&#64;description</code>.
* <br/>
* <b>Note</b>: Should be defined in a Mojo Type.
* <br/>
* <b>Note</b>: Mojo's description is auto-detect.
*/
String DESCRIPTION = "description";
/**
* Refer to <code>&#64;execute ...</code>.
* <br/>
* <b>Note</b>: Should be defined in a Mojo Type.
*/
String EXECUTE = "execute";
/**
* The Mojo goal will be executed in isolation.
* <br/>
* Refer to <code>&#64;execute goal="&lt;goalName&gt;"</code>.
* <br/>
* <b>Note</b>: Should be defined in a Mojo Type.
*/
String EXECUTE_GOAL = "goal";
/**
* The Mojo will be invoke in a parallel lifecycle.
* <br/>
* Refer to <code>&#64;execute lifecycle="&lt;lifecycleId&gt;"</code>.
* <br/>
* <b>Note</b>: Should be defined in a Mojo Type.
*/
String EXECUTE_LIFECYCLE = "lifecycle";
/**
* The Mojo will be invoke in a parallel lifecycle, ending at the given phase.
* <br/>
* Refer to <code>&#64;execute phase="&lt;phaseName&gt;"</code>.
* <br/>
* Refer to <code>&#64;execute lifecycle="&lt;lifecycleId&gt;" phase="&lt;phaseName&gt;"</code>.
* <br/>
* <b>Note</b>: Should be defined in a Mojo Type.
*/
String EXECUTE_PHASE = "phase";
/**
* Refer to <code>&#64;executionStrategy &lt;strategy&gt;</code>.
* <br/>
* <b>Note</b>: Should be defined in a Mojo Type.
*/
String EXECUTION_STATEGY = "executionStrategy";
/**
* The name for the Mojo that users will reference to execute it.
* <br/>
* Refer to <code>&#64;goal &lt;goalName&gt;</code>.
* <br/>
* <b>Note</b>: Should be defined in a Mojo Type.
*/
String GOAL = "goal";
/**
* The Mojo's fully-qualified class name.
* <br/>
* Refer to <code>&#64;implementation</code>.
* <br/>
* <b>Note</b>: Should be defined in a Mojo Type.
* <br/>
* <b>Note</b>: Mojo's implementation is auto-detect.
*/
String IMPLEMENTATION = "implementation";
/**
* Allow Mojo inheritance.
* <br/>
* Refer to <code>&#64;inheritByDefault &lt;true|false&gt;</code>.
* <br/>
* <b>Note</b>: Should be defined in a Mojo Type.
*/
String INHERIT_BY_DEFAULT = "inheritByDefault";
/**
* Refer to <code>&#64;instantiationStrategy &lt;per-lookup&gt;</code>.
* <br/>
* <b>Note</b>: Should be defined in a Mojo Type.
*/
String INSTANTIATION_STRATEGY = "instantiationStrategy";
/**
* The implementation language for the Mojo.
* <br/>
* Refer to <code>&#64;language</code>.
* <br/>
* <b>Note</b>: Should be defined in a Mojo Type.
* <br/>
* <b>Note</b>: Mojo's implementation is auto-detect.
*/
String LANGUAGE = "language";
/**
* Specifies the execution strategy
* <br/>
* Refer to <code>&#64;attainAlways</code>.
* <br/>
* <b>Note</b>: Should be defined in a Mojo Type.
*/
String MULTI_EXECUTION_STRATEGY = "attainAlways";
/**
* Refer to <code>&#64;phase &lt;phaseName&gt;</code>.
* <br/>
* <b>Note</b>: Should be defined in a Mojo Type.
*/
String PHASE = "phase";
/**
* Flags this Mojo as requiring the dependencies in the specified scope (or an implied scope) to be resolved
* before it can execute. Currently supports <code>compile</code>, <code>runtime</code>, and <code>test</code> scopes.
* <br/>
* Refer to <code>&#64;requiresDependencyResolution &lt;requiredScope&gt;</code>.
* <br/>
* <b>Note</b>: Should be defined in a Mojo Type.
*/
String REQUIRES_DEPENDENCY_RESOLUTION = "requiresDependencyResolution";
/**
* Refer to <code>&#64;requiresDirectInvocation &lt;true|false&gt;</code>.
* <br/>
* <b>Note</b>: Should be defined in a Mojo Type.
*/
String REQUIRES_DIRECT_INVOCATION = "requiresDirectInvocation";
/**
* Flags this Mojo to run online.
* <br/>
* Refer to <code>&#64;requiresOnline &lt;true|false&gt;</code>.
* <br/>
* <b>Note</b>: Should be defined in a Mojo Type.
*/
String REQUIRES_ONLINE = "requiresOnline";
/**
* Flags this Mojo to run inside of a project.
* <br/>
* Refer to <code>&#64;requiresProject &lt;true|false&gt;</code>.
* <br/>
* <b>Note</b>: Should be defined in a Mojo Type.
*/
String REQUIRES_PROJECT = "requiresProject";
/**
* Flags this Mojo to run inside reports.
* <br/>
* Refer to <code>&#64;requiresReports &lt;true|false&gt;</code>.
* <br/>
* <b>Note</b>: Should be defined in a Mojo Type.
*/
String REQUIRES_REPORTS = "requiresReports";
// ----------------------------------------------------------------------
// Descriptor for fields i.e. parameters
// ----------------------------------------------------------------------
/**
* Populates the field with an instance of a Plexus component. This is like declaring a requirement in a
* Plexus component.
* <br/>
* Refer to <code>&#64;component ...</code>.
* <br/>
* <b>Note</b>: Should be defined in a Mojo Field.
*/
String COMPONENT = "component";
/**
* Refer to <code>&#64;component role="..."</code>.
* <br/>
* <b>Note</b>: Should be defined in a Mojo Field.
*/
String COMPONENT_ROLE = "role";
/**
* Refer to <code>&#64;component roleHint="..."</code>.
* <br/>
* <b>Note</b>: Should be defined in a Mojo Field.
*/
String COMPONENT_ROLEHINT = "roleHint";
/**
* Refer to <code>&#64;parameter ...</code>
* <br/>
* <b>Note</b>: Should be defined in a Mojo Field.
*/
String PARAMETER = "parameter";
/**
* This defines an alias which can be used to configure a parameter. This is primarily useful to improve
* user-friendliness.
* <br/>
* Refer to <code>&#64;parameter alias="..."</code>.
* <br/>
* <b>Note</b>: Should be defined in a Mojo Field.
*/
String PARAMETER_ALIAS = "alias";
/**
* This defines the default value to be injected into this parameter of the Mojo at buildtime.
* <br/>
* Refer to <code>&#64;parameter default-value="..."</code>.
* <br/>
* <b>Note</b>: Should be defined in a Mojo Field.
*/
String PARAMETER_DEFAULT_VALUE = "default-value";
/**
* This defines the expression used to calculate the value to be injected into this parameter of the
* Mojo at buildtime.
* <br/>
* Refer to <code>&#64;parameter expression="..."</code>.
* <br/>
* <b>Note</b>: Should be defined in a Mojo Field.
*/
String PARAMETER_EXPRESSION = "expression";
/**
* This defines the default implementation in the case the parameter type is an interface.
* <br/>
* Refer to <code>&#64;parameter implementation="..."</code>.
* <br/>
* <b>Note</b>: Should be defined in a Mojo Field.
*/
String PARAMETER_IMPLEMENTATION = "implementation";
/**
* This indicates the base name of the bean properties used to read/write this parameter's value.
* <br/>
* Refer to <code>&#64;parameter property="project"</code>
* <p/>
* Would say there is a getProject() method and a setProject(Project) method. Here the field
* name would not be the basis for the parameter's name. This mode of operation will allow the
* mojos to be usable as beans and will be the promoted form of use.
* <br/>
* <b>Note</b>: Should be defined in a Mojo Field.
*/
String PARAMETER_PROPERTY = "property";
/**
* Specifies that this parameter cannot be configured directly by the user (as in the case of POM-specified
* configuration).
* <br/>
* Refer to <code>&#64;readonly</code>.
* <br/>
* <b>Note</b>: Should be defined in a Mojo Field.
*/
String READONLY = "readonly";
/**
* Whether this parameter is required for the Mojo to function
* <br/>
* Refer to <code>&#64;required</code>.
* <br/>
* <b>Note</b>: Should be defined in a Mojo Field.
*/
String REQUIRED = "required";
// ----------------------------------------------------------------------
// Descriptor for type and fields
// ----------------------------------------------------------------------
/**
* Refer to <code>&#64;since &lt;deprecated-text&gt;</code>
* <br/>
* <b>Note</b>: Could be defined in a Mojo Type or a Mojo Field.
*/
String SINCE = "since";
/**
* Refer to <code>&#64;deprecated &lt;since-text&gt;</code>
* <br/>
* <b>Note</b>: Could be defined in a Mojo Type or a Mojo Field.
*/
String DEPRECATED = "deprecated";
}

View File

@ -48,116 +48,107 @@ import java.util.TreeMap;
/** /**
* Extracts Mojo descriptors from <a href="http://java.sun.com/">Java</a> sources. * Extracts Mojo descriptors from <a href="http://java.sun.com/">Java</a> sources.
* <br/> * <br/>
* For more information, have a look to: * For more information about the usage tag, have a look to:
* <a href="http://maven.apache.org/developers/mojo-api-specification.html">http://maven.apache.org/developers/mojo-api-specification.html</a> * <a href="http://maven.apache.org/developers/mojo-api-specification.html">http://maven.apache.org/developers/mojo-api-specification.html</a>
* *
* @todo add example usage tag that can be shown in the doco
* @todo need to add validation directives so that systems embedding maven2 can * @todo need to add validation directives so that systems embedding maven2 can
* get validation directives to help users in IDEs. * get validation directives to help users in IDEs.
* @version $Id$ * @version $Id$
* @see org.apache.maven.plugin.descriptor.MojoDescriptor
*/ */
public class JavaMojoDescriptorExtractor public class JavaMojoDescriptorExtractor
extends AbstractLogEnabled extends AbstractLogEnabled
implements MojoDescriptorExtractor implements MojoDescriptorExtractor, JavaMojoAnnotation
{ {
/** Refer to <code>&#64;instantiationStrategy</code> */ /** @deprecated since 2.4, use {@link JavaMojoAnnotation#INSTANTIATION_STRATEGY} instead of. */
public static final String MAVEN_PLUGIN_INSTANTIATION = "instantiationStrategy"; public static final String MAVEN_PLUGIN_INSTANTIATION = JavaMojoAnnotation.INSTANTIATION_STRATEGY;
/** Refer to <code>&#64;configurator</code> */ /** @deprecated since 2.4, use {@link JavaMojoAnnotation#CONFIGURATOR} instead of. */
public static final String CONFIGURATOR = "configurator"; public static final String CONFIGURATOR = JavaMojoAnnotation.CONFIGURATOR;
/** Refer to <code>&#64;parameter</code> */ /** @deprecated since 2.4, use {@link JavaMojoAnnotation#PARAMETER} instead of. */
public static final String PARAMETER = "parameter"; public static final String PARAMETER = JavaMojoAnnotation.PARAMETER;
/** Refer to <code>expression</code> combined to <code>&#64;parameter</code> */ /** @deprecated since 2.4, use {@link JavaMojoAnnotation#PARAMETER_EXPRESSION} instead of. */
public static final String PARAMETER_EXPRESSION = "expression"; public static final String PARAMETER_EXPRESSION = JavaMojoAnnotation.PARAMETER_EXPRESSION;
/** Refer to <code>default-value</code> combined to <code>&#64;parameter</code> */ /** @deprecated since 2.4, use {@link JavaMojoAnnotation#PARAMETER_DEFAULT_VALUE} instead of. */
public static final String PARAMETER_DEFAULT_VALUE = "default-value"; public static final String PARAMETER_DEFAULT_VALUE = JavaMojoAnnotation.PARAMETER_DEFAULT_VALUE;
/** Refer to <code>alias</code> combined to <code>&#64;parameter</code> */ /** @deprecated since 2.4, use {@link JavaMojoAnnotation#PARAMETER_ALIAS} instead of. */
public static final String PARAMETER_ALIAS = "alias"; public static final String PARAMETER_ALIAS = JavaMojoAnnotation.PARAMETER_ALIAS;
/** Refer to <code>&#64;since</code> */ /** @deprecated since 2.4, use {@link JavaMojoAnnotation#SINCE} instead of. */
public static final String SINCE = "since"; public static final String SINCE = JavaMojoAnnotation.SINCE;
/** This defines the default implementation in the case the parameter type is an interface. /** @deprecated since 2.4, use {@link JavaMojoAnnotation#PARAMETER_IMPLEMENTATION} instead of. */
* Refer to <code>implementation</code> combined to &#64;parameter */ public static final String PARAMETER_IMPLEMENTATION = JavaMojoAnnotation.PARAMETER_IMPLEMENTATION;
public static final String PARAMETER_IMPLEMENTATION = "implementation";
/** /** @deprecated since 2.4, use {@link JavaMojoAnnotation#PARAMETER_PROPERTY} instead of. */
* This indicates the base name of the bean properties used to read/write this parameter's value. public static final String PARAMETER_PROPERTY = JavaMojoAnnotation.PARAMETER_PROPERTY;
* <br/>
* Refer to <code>&#64;parameter property="project"</code>
* <p/>
* Would say there is a getProject() method and a setProject(Project) method. Here the field
* name would not be the basis for the parameter's name. This mode of operation will allow the
* mojos to be usable as beans and will be the promoted form of use.
*/
public static final String PARAMETER_PROPERTY = "property";
/** Refer to <code>&#64;required</code> */ /** @deprecated since 2.4, use {@link JavaMojoAnnotation#REQUIRED} instead of. */
public static final String REQUIRED = "required"; public static final String REQUIRED = JavaMojoAnnotation.REQUIRED;
/** Refer to <code>&#64;deprecated</code> */ /** @deprecated since 2.4, use {@link JavaMojoAnnotation#DEPRECATED} instead of. */
public static final String DEPRECATED = "deprecated"; public static final String DEPRECATED = JavaMojoAnnotation.DEPRECATED;
/** Refer to <code>&#64;readonly</code> */ /** @deprecated since 2.4, use {@link JavaMojoAnnotation#READONLY} instead of. */
public static final String READONLY = "readonly"; public static final String READONLY = JavaMojoAnnotation.READONLY;
/** Refer to <code>&#64;goal</code> */ /** @deprecated since 2.4, use {@link JavaMojoAnnotation#GOAL} instead of. */
public static final String GOAL = "goal"; public static final String GOAL = JavaMojoAnnotation.GOAL;
/** Refer to <code>&#64;phase</code> */ /** @deprecated since 2.4, use {@link JavaMojoAnnotation#PHASE} instead of. */
public static final String PHASE = "phase"; public static final String PHASE = JavaMojoAnnotation.PHASE;
/** Refer to <code>&#64;execute</code> */ /** @deprecated since 2.4, use {@link JavaMojoAnnotation#EXECUTE} instead of. */
public static final String EXECUTE = "execute"; public static final String EXECUTE = JavaMojoAnnotation.EXECUTE;
/** Refer to <code>lifecycle</code> combined to <code>&#64;execute</code> */ /** @deprecated since 2.4, use {@link JavaMojoAnnotation#EXECUTE_LIFECYCLE} instead of. */
public static final String EXECUTE_LIFECYCLE = "lifecycle"; public static final String EXECUTE_LIFECYCLE = JavaMojoAnnotation.EXECUTE_LIFECYCLE;
/** Refer to <code>phase</code> combined to <code>&#64;execute</code> */ /** @deprecated since 2.4, use {@link JavaMojoAnnotation#EXECUTE_PHASE} instead of. */
public static final String EXECUTE_PHASE = "phase"; public static final String EXECUTE_PHASE = JavaMojoAnnotation.EXECUTE_PHASE;
/** Refer to <code>goal</code> combined to <code>&#64;execute</code> */ /** @deprecated since 2.4, use {@link JavaMojoAnnotation#EXECUTE_GOAL} instead of. */
public static final String EXECUTE_GOAL = "goal"; public static final String EXECUTE_GOAL = JavaMojoAnnotation.EXECUTE_GOAL;
/** Refer to <code>&#64;description</code> */ /** @deprecated since 2.4, use {@link JavaMojoAnnotation#DESCRIPTION} instead of. */
public static final String GOAL_DESCRIPTION = "description"; public static final String GOAL_DESCRIPTION = JavaMojoAnnotation.DESCRIPTION;
/** Refer to <code>requiresDependencyResolution</code> combined to <code>&#64;goal</code> */ /** @deprecated since 2.4, use {@link JavaMojoAnnotation#REQUIRES_DEPENDENCY_RESOLUTION} instead of. */
public static final String GOAL_REQUIRES_DEPENDENCY_RESOLUTION = "requiresDependencyResolution"; public static final String GOAL_REQUIRES_DEPENDENCY_RESOLUTION = JavaMojoAnnotation.REQUIRES_DEPENDENCY_RESOLUTION;
/** Refer to <code>requiresProject</code> combined to <code>&#64;goal</code> */ /** @deprecated since 2.4, use {@link JavaMojoAnnotation#REQUIRES_PROJECT} instead of. */
public static final String GOAL_REQUIRES_PROJECT = "requiresProject"; public static final String GOAL_REQUIRES_PROJECT = JavaMojoAnnotation.REQUIRES_PROJECT;
/** Refer to <code>requiresReports</code> combined to <code>&#64;goal</code> */ /** @deprecated since 2.4, use {@link JavaMojoAnnotation#REQUIRES_REPORTS} instead of. */
public static final String GOAL_REQUIRES_REPORTS = "requiresReports"; public static final String GOAL_REQUIRES_REPORTS = JavaMojoAnnotation.REQUIRES_REPORTS;
/** Refer to <code>aggregator</code> combined to <code>&#64;goal</code> */ /** @deprecated since 2.4, use {@link JavaMojoAnnotation#AGGREGATOR} instead of. */
public static final String GOAL_IS_AGGREGATOR = "aggregator"; public static final String GOAL_IS_AGGREGATOR = JavaMojoAnnotation.AGGREGATOR;
/** Refer to <code>requiresOnline</code> combined to <code>&#64;goal</code> */ /** @deprecated since 2.4, use {@link JavaMojoAnnotation#REQUIRES_ONLINE} instead of. */
public static final String GOAL_REQUIRES_ONLINE = "requiresOnline"; public static final String GOAL_REQUIRES_ONLINE = JavaMojoAnnotation.REQUIRES_ONLINE;
/** Refer to <code>inheritByDefault</code> combined to <code>&#64;goal</code> */ /** @deprecated since 2.4, use {@link JavaMojoAnnotation#INHERIT_BY_DEFAULT} instead of. */
public static final String GOAL_INHERIT_BY_DEFAULT = "inheritByDefault"; public static final String GOAL_INHERIT_BY_DEFAULT = JavaMojoAnnotation.INHERIT_BY_DEFAULT;
/** Refer to <code>attainAlways</code> combined to <code>&#64;goal</code> */ /** @deprecated since 2.4, use {@link JavaMojoAnnotation#MULTI_EXECUTION_STRATEGY} instead of. */
public static final String GOAL_MULTI_EXECUTION_STRATEGY = "attainAlways"; public static final String GOAL_MULTI_EXECUTION_STRATEGY = JavaMojoAnnotation.MULTI_EXECUTION_STRATEGY;
/** Refer to <code>attainAlways</code> combined to <code>&#64;goal</code> */ /** @deprecated since 2.4, use {@link JavaMojoAnnotation#REQUIRES_DIRECT_INVOCATION} instead of. */
public static final String GOAL_REQUIRES_DIRECT_INVOCATION = "requiresDirectInvocation"; public static final String GOAL_REQUIRES_DIRECT_INVOCATION = JavaMojoAnnotation.REQUIRES_DIRECT_INVOCATION;
/** Refer to <code>&#64;component</code> */ /** @deprecated since 2.4, use {@link JavaMojoAnnotation#COMPONENT} instead of. */
public static final String COMPONENT = "component"; public static final String COMPONENT = JavaMojoAnnotation.COMPONENT;
/** Refer to <code>role</code> combined to <code>&#64;component</code> */ /** @deprecated since 2.4, use {@link JavaMojoAnnotation#COMPONENT_ROLE} instead of. */
public static final String COMPONENT_ROLE = "role"; public static final String COMPONENT_ROLE = JavaMojoAnnotation.COMPONENT_ROLE;
/** Refer to <code>roleHint</code> combined to <code>&#64;component</code> */ /** @deprecated since 2.4, use {@link JavaMojoAnnotation#COMPONENT_ROLEHINT} instead of. */
public static final String COMPONENT_ROLEHINT = "roleHint"; public static final String COMPONENT_ROLEHINT = JavaMojoAnnotation.COMPONENT_ROLEHINT;
/** /**
* @param parameter not null * @param parameter not null
@ -212,14 +203,14 @@ public class JavaMojoDescriptorExtractor
mojoDescriptor.setDescription( javaClass.getComment() ); mojoDescriptor.setDescription( javaClass.getComment() );
DocletTag tag = findInClassHierarchy( javaClass, MAVEN_PLUGIN_INSTANTIATION ); DocletTag tag = findInClassHierarchy( javaClass, JavaMojoAnnotation.INSTANTIATION_STRATEGY );
if ( tag != null ) if ( tag != null )
{ {
mojoDescriptor.setInstantiationStrategy( tag.getValue() ); mojoDescriptor.setInstantiationStrategy( tag.getValue() );
} }
tag = findInClassHierarchy( javaClass, GOAL_MULTI_EXECUTION_STRATEGY ); tag = findInClassHierarchy( javaClass, JavaMojoAnnotation.MULTI_EXECUTION_STRATEGY );
if ( tag != null ) if ( tag != null )
{ {
@ -234,7 +225,7 @@ public class JavaMojoDescriptorExtractor
// Configurator hint // Configurator hint
// ---------------------------------------------------------------------- // ----------------------------------------------------------------------
DocletTag configurator = findInClassHierarchy( javaClass, CONFIGURATOR ); DocletTag configurator = findInClassHierarchy( javaClass, JavaMojoAnnotation.CONFIGURATOR );
if ( configurator != null ) if ( configurator != null )
{ {
@ -245,7 +236,7 @@ public class JavaMojoDescriptorExtractor
// Goal name // Goal name
// ---------------------------------------------------------------------- // ----------------------------------------------------------------------
DocletTag goal = findInClassHierarchy( javaClass, GOAL ); DocletTag goal = findInClassHierarchy( javaClass, JavaMojoAnnotation.GOAL );
if ( goal != null ) if ( goal != null )
{ {
@ -256,7 +247,7 @@ public class JavaMojoDescriptorExtractor
// What version it was introduced in // What version it was introduced in
// ---------------------------------------------------------------------- // ----------------------------------------------------------------------
DocletTag since = findInClassHierarchy( javaClass, SINCE ); DocletTag since = findInClassHierarchy( javaClass, JavaMojoAnnotation.SINCE );
if ( since != null ) if ( since != null )
{ {
@ -267,7 +258,7 @@ public class JavaMojoDescriptorExtractor
// Deprecation hint // Deprecation hint
// ---------------------------------------------------------------------- // ----------------------------------------------------------------------
DocletTag deprecated = javaClass.getTagByName( DEPRECATED ); DocletTag deprecated = javaClass.getTagByName( JavaMojoAnnotation.DEPRECATED );
if ( deprecated != null ) if ( deprecated != null )
{ {
@ -278,7 +269,7 @@ public class JavaMojoDescriptorExtractor
// Phase name // Phase name
// ---------------------------------------------------------------------- // ----------------------------------------------------------------------
DocletTag phase = findInClassHierarchy( javaClass, PHASE ); DocletTag phase = findInClassHierarchy( javaClass, JavaMojoAnnotation.PHASE );
if ( phase != null ) if ( phase != null )
{ {
@ -289,12 +280,12 @@ public class JavaMojoDescriptorExtractor
// Additional phase to execute first // Additional phase to execute first
// ---------------------------------------------------------------------- // ----------------------------------------------------------------------
DocletTag execute = findInClassHierarchy( javaClass, EXECUTE ); DocletTag execute = findInClassHierarchy( javaClass, JavaMojoAnnotation.EXECUTE );
if ( execute != null ) if ( execute != null )
{ {
String executePhase = execute.getNamedParameter( EXECUTE_PHASE ); String executePhase = execute.getNamedParameter( JavaMojoAnnotation.EXECUTE_PHASE );
String executeGoal = execute.getNamedParameter( EXECUTE_GOAL ); String executeGoal = execute.getNamedParameter( JavaMojoAnnotation.EXECUTE_GOAL );
if ( executePhase == null && executeGoal == null ) if ( executePhase == null && executeGoal == null )
{ {
@ -308,7 +299,7 @@ public class JavaMojoDescriptorExtractor
mojoDescriptor.setExecutePhase( executePhase ); mojoDescriptor.setExecutePhase( executePhase );
mojoDescriptor.setExecuteGoal( executeGoal ); mojoDescriptor.setExecuteGoal( executeGoal );
String lifecycle = execute.getNamedParameter( EXECUTE_LIFECYCLE ); String lifecycle = execute.getNamedParameter( JavaMojoAnnotation.EXECUTE_LIFECYCLE );
if ( lifecycle != null ) if ( lifecycle != null )
{ {
@ -325,7 +316,7 @@ public class JavaMojoDescriptorExtractor
// Dependency resolution flag // Dependency resolution flag
// ---------------------------------------------------------------------- // ----------------------------------------------------------------------
DocletTag requiresDependencyResolution = findInClassHierarchy( javaClass, GOAL_REQUIRES_DEPENDENCY_RESOLUTION ); DocletTag requiresDependencyResolution = findInClassHierarchy( javaClass, JavaMojoAnnotation.REQUIRES_DEPENDENCY_RESOLUTION );
if ( requiresDependencyResolution != null ) if ( requiresDependencyResolution != null )
{ {
@ -343,14 +334,14 @@ public class JavaMojoDescriptorExtractor
// Project flag // Project flag
// ---------------------------------------------------------------------- // ----------------------------------------------------------------------
boolean value = getBooleanTagValue( javaClass, GOAL_REQUIRES_PROJECT, mojoDescriptor.isProjectRequired() ); boolean value = getBooleanTagValue( javaClass, JavaMojoAnnotation.REQUIRES_PROJECT, mojoDescriptor.isProjectRequired() );
mojoDescriptor.setProjectRequired( value ); mojoDescriptor.setProjectRequired( value );
// ---------------------------------------------------------------------- // ----------------------------------------------------------------------
// Aggregator flag // Aggregator flag
// ---------------------------------------------------------------------- // ----------------------------------------------------------------------
DocletTag aggregator = findInClassHierarchy( javaClass, GOAL_IS_AGGREGATOR ); DocletTag aggregator = findInClassHierarchy( javaClass, JavaMojoAnnotation.AGGREGATOR );
if ( aggregator != null ) if ( aggregator != null )
{ {
@ -362,21 +353,21 @@ public class JavaMojoDescriptorExtractor
// ---------------------------------------------------------------------- // ----------------------------------------------------------------------
value = value =
getBooleanTagValue( javaClass, GOAL_REQUIRES_DIRECT_INVOCATION, mojoDescriptor.isDirectInvocationOnly() ); getBooleanTagValue( javaClass, JavaMojoAnnotation.REQUIRES_DIRECT_INVOCATION, mojoDescriptor.isDirectInvocationOnly() );
mojoDescriptor.setDirectInvocationOnly( value ); mojoDescriptor.setDirectInvocationOnly( value );
// ---------------------------------------------------------------------- // ----------------------------------------------------------------------
// Online flag // Online flag
// ---------------------------------------------------------------------- // ----------------------------------------------------------------------
value = getBooleanTagValue( javaClass, GOAL_REQUIRES_ONLINE, mojoDescriptor.isOnlineRequired() ); value = getBooleanTagValue( javaClass, JavaMojoAnnotation.REQUIRES_ONLINE, mojoDescriptor.isOnlineRequired() );
mojoDescriptor.setOnlineRequired( value ); mojoDescriptor.setOnlineRequired( value );
// ---------------------------------------------------------------------- // ----------------------------------------------------------------------
// inheritByDefault flag // inheritByDefault flag
// ---------------------------------------------------------------------- // ----------------------------------------------------------------------
value = getBooleanTagValue( javaClass, GOAL_INHERIT_BY_DEFAULT, mojoDescriptor.isInheritedByDefault() ); value = getBooleanTagValue( javaClass, JavaMojoAnnotation.INHERIT_BY_DEFAULT, mojoDescriptor.isInheritedByDefault() );
mojoDescriptor.setInheritedByDefault( value ); mojoDescriptor.setInheritedByDefault( value );
extractParameters( mojoDescriptor, javaClass ); extractParameters( mojoDescriptor, javaClass );
@ -456,18 +447,18 @@ public class JavaMojoDescriptorExtractor
pd.setDescription( field.getComment() ); pd.setDescription( field.getComment() );
DocletTag componentTag = field.getTagByName( COMPONENT ); DocletTag componentTag = field.getTagByName( JavaMojoAnnotation.COMPONENT );
if ( componentTag != null ) if ( componentTag != null )
{ {
String role = componentTag.getNamedParameter( COMPONENT_ROLE ); String role = componentTag.getNamedParameter( JavaMojoAnnotation.COMPONENT_ROLE );
if ( role == null ) if ( role == null )
{ {
role = field.getType().toString(); role = field.getType().toString();
} }
String roleHint = componentTag.getNamedParameter( COMPONENT_ROLEHINT ); String roleHint = componentTag.getNamedParameter( JavaMojoAnnotation.COMPONENT_ROLEHINT );
if ( roleHint == null ) if ( roleHint == null )
{ {
@ -486,7 +477,7 @@ public class JavaMojoDescriptorExtractor
} }
else else
{ {
DocletTag parameter = field.getTagByName( PARAMETER ); DocletTag parameter = field.getTagByName( JavaMojoAnnotation.PARAMETER );
// ---------------------------------------------------------------------- // ----------------------------------------------------------------------
// We will look for a property name here first and use that if present // We will look for a property name here first and use that if present
@ -498,7 +489,7 @@ public class JavaMojoDescriptorExtractor
// will in turn will allow plexus to use the corresponding setter. // will in turn will allow plexus to use the corresponding setter.
// ---------------------------------------------------------------------- // ----------------------------------------------------------------------
String property = parameter.getNamedParameter( PARAMETER_PROPERTY ); String property = parameter.getNamedParameter( JavaMojoAnnotation.PARAMETER_PROPERTY );
if ( !StringUtils.isEmpty( property ) ) if ( !StringUtils.isEmpty( property ) )
{ {
@ -509,40 +500,40 @@ public class JavaMojoDescriptorExtractor
pd.setName( (String) entry.getKey() ); pd.setName( (String) entry.getKey() );
} }
pd.setRequired( field.getTagByName( REQUIRED ) != null ); pd.setRequired( field.getTagByName( JavaMojoAnnotation.REQUIRED ) != null );
pd.setEditable( field.getTagByName( READONLY ) == null ); pd.setEditable( field.getTagByName( JavaMojoAnnotation.READONLY ) == null );
DocletTag deprecationTag = field.getTagByName( DEPRECATED ); DocletTag deprecationTag = field.getTagByName( JavaMojoAnnotation.DEPRECATED );
if ( deprecationTag != null ) if ( deprecationTag != null )
{ {
pd.setDeprecated( deprecationTag.getValue() ); pd.setDeprecated( deprecationTag.getValue() );
} }
DocletTag sinceTag = field.getTagByName( SINCE ); DocletTag sinceTag = field.getTagByName( JavaMojoAnnotation.SINCE );
if ( sinceTag != null ) if ( sinceTag != null )
{ {
pd.setSince( sinceTag.getValue() ); pd.setSince( sinceTag.getValue() );
} }
String alias = parameter.getNamedParameter( PARAMETER_ALIAS ); String alias = parameter.getNamedParameter( JavaMojoAnnotation.PARAMETER_ALIAS );
if ( !StringUtils.isEmpty( alias ) ) if ( !StringUtils.isEmpty( alias ) )
{ {
pd.setAlias( alias ); pd.setAlias( alias );
} }
pd.setExpression( parameter.getNamedParameter( PARAMETER_EXPRESSION ) ); pd.setExpression( parameter.getNamedParameter( JavaMojoAnnotation.PARAMETER_EXPRESSION ) );
if ( "${reports}".equals( pd.getExpression() ) ) if ( "${reports}".equals( pd.getExpression() ) )
{ {
mojoDescriptor.setRequiresReports( true ); mojoDescriptor.setRequiresReports( true );
} }
pd.setDefaultValue( parameter.getNamedParameter( PARAMETER_DEFAULT_VALUE ) ); pd.setDefaultValue( parameter.getNamedParameter( JavaMojoAnnotation.PARAMETER_DEFAULT_VALUE ) );
pd.setImplementation( parameter.getNamedParameter( PARAMETER_IMPLEMENTATION ) ); pd.setImplementation( parameter.getNamedParameter( JavaMojoAnnotation.PARAMETER_IMPLEMENTATION ) );
} }
mojoDescriptor.addParameter( pd ); mojoDescriptor.addParameter( pd );
@ -574,7 +565,7 @@ public class JavaMojoDescriptorExtractor
{ {
JavaField field = classFields[i]; JavaField field = classFields[i];
if ( field.getTagByName( PARAMETER ) != null || field.getTagByName( COMPONENT ) != null ) if ( field.getTagByName( JavaMojoAnnotation.PARAMETER ) != null || field.getTagByName( JavaMojoAnnotation.COMPONENT ) != null )
{ {
rawParams.put( field.getName(), field ); rawParams.put( field.getName(), field );
} }