You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by vs...@apache.org on 2008/02/28 04:58:33 UTC
svn commit: r631836 - in
/maven/plugin-tools/trunk/maven-plugin-tools-java/src/main/java/org/apache/maven/tools/plugin/extractor/java:
JavaMojoAnnotation.java JavaMojoDescriptorExtractor.java
Author: vsiveton
Date: Wed Feb 27 19:58:32 2008
New Revision: 631836
URL: http://svn.apache.org/viewvc?rev=631836&view=rev
Log:
o moved all Mojo annotations in an interface
o deprecates old constants
Added:
maven/plugin-tools/trunk/maven-plugin-tools-java/src/main/java/org/apache/maven/tools/plugin/extractor/java/JavaMojoAnnotation.java (with props)
Modified:
maven/plugin-tools/trunk/maven-plugin-tools-java/src/main/java/org/apache/maven/tools/plugin/extractor/java/JavaMojoDescriptorExtractor.java
Added: maven/plugin-tools/trunk/maven-plugin-tools-java/src/main/java/org/apache/maven/tools/plugin/extractor/java/JavaMojoAnnotation.java
URL: http://svn.apache.org/viewvc/maven/plugin-tools/trunk/maven-plugin-tools-java/src/main/java/org/apache/maven/tools/plugin/extractor/java/JavaMojoAnnotation.java?rev=631836&view=auto
==============================================================================
--- maven/plugin-tools/trunk/maven-plugin-tools-java/src/main/java/org/apache/maven/tools/plugin/extractor/java/JavaMojoAnnotation.java (added)
+++ maven/plugin-tools/trunk/maven-plugin-tools-java/src/main/java/org/apache/maven/tools/plugin/extractor/java/JavaMojoAnnotation.java Wed Feb 27 19:58:32 2008
@@ -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>@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>@configurator <roleHint></code>.
+ * <br/>
+ * <b>Note</b>: Should be defined in a Mojo Type.
+ */
+ String CONFIGURATOR = "configurator";
+
+ /**
+ * The description for the Mojo.
+ * <br/>
+ * Refer to <code>@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>@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>@execute goal="<goalName>"</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>@execute lifecycle="<lifecycleId>"</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>@execute phase="<phaseName>"</code>.
+ * <br/>
+ * Refer to <code>@execute lifecycle="<lifecycleId>" phase="<phaseName>"</code>.
+ * <br/>
+ * <b>Note</b>: Should be defined in a Mojo Type.
+ */
+ String EXECUTE_PHASE = "phase";
+
+ /**
+ * Refer to <code>@executionStrategy <strategy></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>@goal <goalName></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>@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>@inheritByDefault <true|false></code>.
+ * <br/>
+ * <b>Note</b>: Should be defined in a Mojo Type.
+ */
+ String INHERIT_BY_DEFAULT = "inheritByDefault";
+
+ /**
+ * Refer to <code>@instantiationStrategy <per-lookup></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>@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>@attainAlways</code>.
+ * <br/>
+ * <b>Note</b>: Should be defined in a Mojo Type.
+ */
+ String MULTI_EXECUTION_STRATEGY = "attainAlways";
+
+ /**
+ * Refer to <code>@phase <phaseName></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>@requiresDependencyResolution <requiredScope></code>.
+ * <br/>
+ * <b>Note</b>: Should be defined in a Mojo Type.
+ */
+ String REQUIRES_DEPENDENCY_RESOLUTION = "requiresDependencyResolution";
+
+ /**
+ * Refer to <code>@requiresDirectInvocation <true|false></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>@requiresOnline <true|false></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>@requiresProject <true|false></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>@requiresReports <true|false></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>@component ...</code>.
+ * <br/>
+ * <b>Note</b>: Should be defined in a Mojo Field.
+ */
+ String COMPONENT = "component";
+
+ /**
+ * Refer to <code>@component role="..."</code>.
+ * <br/>
+ * <b>Note</b>: Should be defined in a Mojo Field.
+ */
+ String COMPONENT_ROLE = "role";
+
+ /**
+ * Refer to <code>@component roleHint="..."</code>.
+ * <br/>
+ * <b>Note</b>: Should be defined in a Mojo Field.
+ */
+ String COMPONENT_ROLEHINT = "roleHint";
+
+ /**
+ * Refer to <code>@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>@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>@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>@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>@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>@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>@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>@required</code>.
+ * <br/>
+ * <b>Note</b>: Should be defined in a Mojo Field.
+ */
+ String REQUIRED = "required";
+
+ // ----------------------------------------------------------------------
+ // Descriptor for type and fields
+ // ----------------------------------------------------------------------
+
+ /**
+ * Refer to <code>@since <deprecated-text></code>
+ * <br/>
+ * <b>Note</b>: Could be defined in a Mojo Type or a Mojo Field.
+ */
+ String SINCE = "since";
+
+ /**
+ * Refer to <code>@deprecated <since-text></code>
+ * <br/>
+ * <b>Note</b>: Could be defined in a Mojo Type or a Mojo Field.
+ */
+ String DEPRECATED = "deprecated";
+}
Propchange: maven/plugin-tools/trunk/maven-plugin-tools-java/src/main/java/org/apache/maven/tools/plugin/extractor/java/JavaMojoAnnotation.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/plugin-tools/trunk/maven-plugin-tools-java/src/main/java/org/apache/maven/tools/plugin/extractor/java/JavaMojoAnnotation.java
------------------------------------------------------------------------------
svn:keywords = "Author Date Id Revision"
Modified: maven/plugin-tools/trunk/maven-plugin-tools-java/src/main/java/org/apache/maven/tools/plugin/extractor/java/JavaMojoDescriptorExtractor.java
URL: http://svn.apache.org/viewvc/maven/plugin-tools/trunk/maven-plugin-tools-java/src/main/java/org/apache/maven/tools/plugin/extractor/java/JavaMojoDescriptorExtractor.java?rev=631836&r1=631835&r2=631836&view=diff
==============================================================================
--- maven/plugin-tools/trunk/maven-plugin-tools-java/src/main/java/org/apache/maven/tools/plugin/extractor/java/JavaMojoDescriptorExtractor.java (original)
+++ maven/plugin-tools/trunk/maven-plugin-tools-java/src/main/java/org/apache/maven/tools/plugin/extractor/java/JavaMojoDescriptorExtractor.java Wed Feb 27 19:58:32 2008
@@ -48,116 +48,107 @@
/**
* Extracts Mojo descriptors from <a href="http://java.sun.com/">Java</a> sources.
* <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>
*
- * @todo add example usage tag that can be shown in the doco
* @todo need to add validation directives so that systems embedding maven2 can
* get validation directives to help users in IDEs.
* @version $Id$
+ * @see org.apache.maven.plugin.descriptor.MojoDescriptor
*/
public class JavaMojoDescriptorExtractor
extends AbstractLogEnabled
- implements MojoDescriptorExtractor
+ implements MojoDescriptorExtractor, JavaMojoAnnotation
{
- /** Refer to <code>@instantiationStrategy</code> */
- public static final String MAVEN_PLUGIN_INSTANTIATION = "instantiationStrategy";
+ /** @deprecated since 2.4, use {@link JavaMojoAnnotation#INSTANTIATION_STRATEGY} instead of. */
+ public static final String MAVEN_PLUGIN_INSTANTIATION = JavaMojoAnnotation.INSTANTIATION_STRATEGY;
- /** Refer to <code>@configurator</code> */
- public static final String CONFIGURATOR = "configurator";
+ /** @deprecated since 2.4, use {@link JavaMojoAnnotation#CONFIGURATOR} instead of. */
+ public static final String CONFIGURATOR = JavaMojoAnnotation.CONFIGURATOR;
- /** Refer to <code>@parameter</code> */
- public static final String PARAMETER = "parameter";
+ /** @deprecated since 2.4, use {@link JavaMojoAnnotation#PARAMETER} instead of. */
+ public static final String PARAMETER = JavaMojoAnnotation.PARAMETER;
- /** Refer to <code>expression</code> combined to <code>@parameter</code> */
- public static final String PARAMETER_EXPRESSION = "expression";
+ /** @deprecated since 2.4, use {@link JavaMojoAnnotation#PARAMETER_EXPRESSION} instead of. */
+ public static final String PARAMETER_EXPRESSION = JavaMojoAnnotation.PARAMETER_EXPRESSION;
- /** Refer to <code>default-value</code> combined to <code>@parameter</code> */
- public static final String PARAMETER_DEFAULT_VALUE = "default-value";
+ /** @deprecated since 2.4, use {@link JavaMojoAnnotation#PARAMETER_DEFAULT_VALUE} instead of. */
+ public static final String PARAMETER_DEFAULT_VALUE = JavaMojoAnnotation.PARAMETER_DEFAULT_VALUE;
- /** Refer to <code>alias</code> combined to <code>@parameter</code> */
- public static final String PARAMETER_ALIAS = "alias";
+ /** @deprecated since 2.4, use {@link JavaMojoAnnotation#PARAMETER_ALIAS} instead of. */
+ public static final String PARAMETER_ALIAS = JavaMojoAnnotation.PARAMETER_ALIAS;
- /** Refer to <code>@since</code> */
- public static final String SINCE = "since";
+ /** @deprecated since 2.4, use {@link JavaMojoAnnotation#SINCE} instead of. */
+ public static final String SINCE = JavaMojoAnnotation.SINCE;
- /** This defines the default implementation in the case the parameter type is an interface.
- * Refer to <code>implementation</code> combined to @parameter */
- public static final String PARAMETER_IMPLEMENTATION = "implementation";
+ /** @deprecated since 2.4, use {@link JavaMojoAnnotation#PARAMETER_IMPLEMENTATION} instead of. */
+ public static final String PARAMETER_IMPLEMENTATION = JavaMojoAnnotation.PARAMETER_IMPLEMENTATION;
- /**
- * This indicates the base name of the bean properties used to read/write this parameter's value.
- * <br/>
- * Refer to <code>@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";
+ /** @deprecated since 2.4, use {@link JavaMojoAnnotation#PARAMETER_PROPERTY} instead of. */
+ public static final String PARAMETER_PROPERTY = JavaMojoAnnotation.PARAMETER_PROPERTY;
- /** Refer to <code>@required</code> */
- public static final String REQUIRED = "required";
+ /** @deprecated since 2.4, use {@link JavaMojoAnnotation#REQUIRED} instead of. */
+ public static final String REQUIRED = JavaMojoAnnotation.REQUIRED;
- /** Refer to <code>@deprecated</code> */
- public static final String DEPRECATED = "deprecated";
+ /** @deprecated since 2.4, use {@link JavaMojoAnnotation#DEPRECATED} instead of. */
+ public static final String DEPRECATED = JavaMojoAnnotation.DEPRECATED;
- /** Refer to <code>@readonly</code> */
- public static final String READONLY = "readonly";
+ /** @deprecated since 2.4, use {@link JavaMojoAnnotation#READONLY} instead of. */
+ public static final String READONLY = JavaMojoAnnotation.READONLY;
- /** Refer to <code>@goal</code> */
- public static final String GOAL = "goal";
+ /** @deprecated since 2.4, use {@link JavaMojoAnnotation#GOAL} instead of. */
+ public static final String GOAL = JavaMojoAnnotation.GOAL;
- /** Refer to <code>@phase</code> */
- public static final String PHASE = "phase";
+ /** @deprecated since 2.4, use {@link JavaMojoAnnotation#PHASE} instead of. */
+ public static final String PHASE = JavaMojoAnnotation.PHASE;
- /** Refer to <code>@execute</code> */
- public static final String EXECUTE = "execute";
+ /** @deprecated since 2.4, use {@link JavaMojoAnnotation#EXECUTE} instead of. */
+ public static final String EXECUTE = JavaMojoAnnotation.EXECUTE;
- /** Refer to <code>lifecycle</code> combined to <code>@execute</code> */
- public static final String EXECUTE_LIFECYCLE = "lifecycle";
+ /** @deprecated since 2.4, use {@link JavaMojoAnnotation#EXECUTE_LIFECYCLE} instead of. */
+ public static final String EXECUTE_LIFECYCLE = JavaMojoAnnotation.EXECUTE_LIFECYCLE;
- /** Refer to <code>phase</code> combined to <code>@execute</code> */
- public static final String EXECUTE_PHASE = "phase";
+ /** @deprecated since 2.4, use {@link JavaMojoAnnotation#EXECUTE_PHASE} instead of. */
+ public static final String EXECUTE_PHASE = JavaMojoAnnotation.EXECUTE_PHASE;
- /** Refer to <code>goal</code> combined to <code>@execute</code> */
- public static final String EXECUTE_GOAL = "goal";
+ /** @deprecated since 2.4, use {@link JavaMojoAnnotation#EXECUTE_GOAL} instead of. */
+ public static final String EXECUTE_GOAL = JavaMojoAnnotation.EXECUTE_GOAL;
- /** Refer to <code>@description</code> */
- public static final String GOAL_DESCRIPTION = "description";
+ /** @deprecated since 2.4, use {@link JavaMojoAnnotation#DESCRIPTION} instead of. */
+ public static final String GOAL_DESCRIPTION = JavaMojoAnnotation.DESCRIPTION;
- /** Refer to <code>requiresDependencyResolution</code> combined to <code>@goal</code> */
- public static final String GOAL_REQUIRES_DEPENDENCY_RESOLUTION = "requiresDependencyResolution";
+ /** @deprecated since 2.4, use {@link JavaMojoAnnotation#REQUIRES_DEPENDENCY_RESOLUTION} instead of. */
+ public static final String GOAL_REQUIRES_DEPENDENCY_RESOLUTION = JavaMojoAnnotation.REQUIRES_DEPENDENCY_RESOLUTION;
- /** Refer to <code>requiresProject</code> combined to <code>@goal</code> */
- public static final String GOAL_REQUIRES_PROJECT = "requiresProject";
+ /** @deprecated since 2.4, use {@link JavaMojoAnnotation#REQUIRES_PROJECT} instead of. */
+ public static final String GOAL_REQUIRES_PROJECT = JavaMojoAnnotation.REQUIRES_PROJECT;
- /** Refer to <code>requiresReports</code> combined to <code>@goal</code> */
- public static final String GOAL_REQUIRES_REPORTS = "requiresReports";
+ /** @deprecated since 2.4, use {@link JavaMojoAnnotation#REQUIRES_REPORTS} instead of. */
+ public static final String GOAL_REQUIRES_REPORTS = JavaMojoAnnotation.REQUIRES_REPORTS;
- /** Refer to <code>aggregator</code> combined to <code>@goal</code> */
- public static final String GOAL_IS_AGGREGATOR = "aggregator";
+ /** @deprecated since 2.4, use {@link JavaMojoAnnotation#AGGREGATOR} instead of. */
+ public static final String GOAL_IS_AGGREGATOR = JavaMojoAnnotation.AGGREGATOR;
- /** Refer to <code>requiresOnline</code> combined to <code>@goal</code> */
- public static final String GOAL_REQUIRES_ONLINE = "requiresOnline";
+ /** @deprecated since 2.4, use {@link JavaMojoAnnotation#REQUIRES_ONLINE} instead of. */
+ public static final String GOAL_REQUIRES_ONLINE = JavaMojoAnnotation.REQUIRES_ONLINE;
- /** Refer to <code>inheritByDefault</code> combined to <code>@goal</code> */
- public static final String GOAL_INHERIT_BY_DEFAULT = "inheritByDefault";
+ /** @deprecated since 2.4, use {@link JavaMojoAnnotation#INHERIT_BY_DEFAULT} instead of. */
+ public static final String GOAL_INHERIT_BY_DEFAULT = JavaMojoAnnotation.INHERIT_BY_DEFAULT;
- /** Refer to <code>attainAlways</code> combined to <code>@goal</code> */
- public static final String GOAL_MULTI_EXECUTION_STRATEGY = "attainAlways";
+ /** @deprecated since 2.4, use {@link JavaMojoAnnotation#MULTI_EXECUTION_STRATEGY} instead of. */
+ public static final String GOAL_MULTI_EXECUTION_STRATEGY = JavaMojoAnnotation.MULTI_EXECUTION_STRATEGY;
- /** Refer to <code>attainAlways</code> combined to <code>@goal</code> */
- public static final String GOAL_REQUIRES_DIRECT_INVOCATION = "requiresDirectInvocation";
+ /** @deprecated since 2.4, use {@link JavaMojoAnnotation#REQUIRES_DIRECT_INVOCATION} instead of. */
+ public static final String GOAL_REQUIRES_DIRECT_INVOCATION = JavaMojoAnnotation.REQUIRES_DIRECT_INVOCATION;
- /** Refer to <code>@component</code> */
- public static final String COMPONENT = "component";
+ /** @deprecated since 2.4, use {@link JavaMojoAnnotation#COMPONENT} instead of. */
+ public static final String COMPONENT = JavaMojoAnnotation.COMPONENT;
- /** Refer to <code>role</code> combined to <code>@component</code> */
- public static final String COMPONENT_ROLE = "role";
+ /** @deprecated since 2.4, use {@link JavaMojoAnnotation#COMPONENT_ROLE} instead of. */
+ public static final String COMPONENT_ROLE = JavaMojoAnnotation.COMPONENT_ROLE;
- /** Refer to <code>roleHint</code> combined to <code>@component</code> */
- public static final String COMPONENT_ROLEHINT = "roleHint";
+ /** @deprecated since 2.4, use {@link JavaMojoAnnotation#COMPONENT_ROLEHINT} instead of. */
+ public static final String COMPONENT_ROLEHINT = JavaMojoAnnotation.COMPONENT_ROLEHINT;
/**
* @param parameter not null
@@ -212,14 +203,14 @@
mojoDescriptor.setDescription( javaClass.getComment() );
- DocletTag tag = findInClassHierarchy( javaClass, MAVEN_PLUGIN_INSTANTIATION );
+ DocletTag tag = findInClassHierarchy( javaClass, JavaMojoAnnotation.INSTANTIATION_STRATEGY );
if ( tag != null )
{
mojoDescriptor.setInstantiationStrategy( tag.getValue() );
}
- tag = findInClassHierarchy( javaClass, GOAL_MULTI_EXECUTION_STRATEGY );
+ tag = findInClassHierarchy( javaClass, JavaMojoAnnotation.MULTI_EXECUTION_STRATEGY );
if ( tag != null )
{
@@ -234,7 +225,7 @@
// Configurator hint
// ----------------------------------------------------------------------
- DocletTag configurator = findInClassHierarchy( javaClass, CONFIGURATOR );
+ DocletTag configurator = findInClassHierarchy( javaClass, JavaMojoAnnotation.CONFIGURATOR );
if ( configurator != null )
{
@@ -245,7 +236,7 @@
// Goal name
// ----------------------------------------------------------------------
- DocletTag goal = findInClassHierarchy( javaClass, GOAL );
+ DocletTag goal = findInClassHierarchy( javaClass, JavaMojoAnnotation.GOAL );
if ( goal != null )
{
@@ -256,7 +247,7 @@
// What version it was introduced in
// ----------------------------------------------------------------------
- DocletTag since = findInClassHierarchy( javaClass, SINCE );
+ DocletTag since = findInClassHierarchy( javaClass, JavaMojoAnnotation.SINCE );
if ( since != null )
{
@@ -267,7 +258,7 @@
// Deprecation hint
// ----------------------------------------------------------------------
- DocletTag deprecated = javaClass.getTagByName( DEPRECATED );
+ DocletTag deprecated = javaClass.getTagByName( JavaMojoAnnotation.DEPRECATED );
if ( deprecated != null )
{
@@ -278,7 +269,7 @@
// Phase name
// ----------------------------------------------------------------------
- DocletTag phase = findInClassHierarchy( javaClass, PHASE );
+ DocletTag phase = findInClassHierarchy( javaClass, JavaMojoAnnotation.PHASE );
if ( phase != null )
{
@@ -289,12 +280,12 @@
// Additional phase to execute first
// ----------------------------------------------------------------------
- DocletTag execute = findInClassHierarchy( javaClass, EXECUTE );
+ DocletTag execute = findInClassHierarchy( javaClass, JavaMojoAnnotation.EXECUTE );
if ( execute != null )
{
- String executePhase = execute.getNamedParameter( EXECUTE_PHASE );
- String executeGoal = execute.getNamedParameter( EXECUTE_GOAL );
+ String executePhase = execute.getNamedParameter( JavaMojoAnnotation.EXECUTE_PHASE );
+ String executeGoal = execute.getNamedParameter( JavaMojoAnnotation.EXECUTE_GOAL );
if ( executePhase == null && executeGoal == null )
{
@@ -308,7 +299,7 @@
mojoDescriptor.setExecutePhase( executePhase );
mojoDescriptor.setExecuteGoal( executeGoal );
- String lifecycle = execute.getNamedParameter( EXECUTE_LIFECYCLE );
+ String lifecycle = execute.getNamedParameter( JavaMojoAnnotation.EXECUTE_LIFECYCLE );
if ( lifecycle != null )
{
@@ -325,7 +316,7 @@
// Dependency resolution flag
// ----------------------------------------------------------------------
- DocletTag requiresDependencyResolution = findInClassHierarchy( javaClass, GOAL_REQUIRES_DEPENDENCY_RESOLUTION );
+ DocletTag requiresDependencyResolution = findInClassHierarchy( javaClass, JavaMojoAnnotation.REQUIRES_DEPENDENCY_RESOLUTION );
if ( requiresDependencyResolution != null )
{
@@ -343,14 +334,14 @@
// Project flag
// ----------------------------------------------------------------------
- boolean value = getBooleanTagValue( javaClass, GOAL_REQUIRES_PROJECT, mojoDescriptor.isProjectRequired() );
+ boolean value = getBooleanTagValue( javaClass, JavaMojoAnnotation.REQUIRES_PROJECT, mojoDescriptor.isProjectRequired() );
mojoDescriptor.setProjectRequired( value );
// ----------------------------------------------------------------------
// Aggregator flag
// ----------------------------------------------------------------------
- DocletTag aggregator = findInClassHierarchy( javaClass, GOAL_IS_AGGREGATOR );
+ DocletTag aggregator = findInClassHierarchy( javaClass, JavaMojoAnnotation.AGGREGATOR );
if ( aggregator != null )
{
@@ -362,21 +353,21 @@
// ----------------------------------------------------------------------
value =
- getBooleanTagValue( javaClass, GOAL_REQUIRES_DIRECT_INVOCATION, mojoDescriptor.isDirectInvocationOnly() );
+ getBooleanTagValue( javaClass, JavaMojoAnnotation.REQUIRES_DIRECT_INVOCATION, mojoDescriptor.isDirectInvocationOnly() );
mojoDescriptor.setDirectInvocationOnly( value );
// ----------------------------------------------------------------------
// Online flag
// ----------------------------------------------------------------------
- value = getBooleanTagValue( javaClass, GOAL_REQUIRES_ONLINE, mojoDescriptor.isOnlineRequired() );
+ value = getBooleanTagValue( javaClass, JavaMojoAnnotation.REQUIRES_ONLINE, mojoDescriptor.isOnlineRequired() );
mojoDescriptor.setOnlineRequired( value );
// ----------------------------------------------------------------------
// inheritByDefault flag
// ----------------------------------------------------------------------
- value = getBooleanTagValue( javaClass, GOAL_INHERIT_BY_DEFAULT, mojoDescriptor.isInheritedByDefault() );
+ value = getBooleanTagValue( javaClass, JavaMojoAnnotation.INHERIT_BY_DEFAULT, mojoDescriptor.isInheritedByDefault() );
mojoDescriptor.setInheritedByDefault( value );
extractParameters( mojoDescriptor, javaClass );
@@ -456,18 +447,18 @@
pd.setDescription( field.getComment() );
- DocletTag componentTag = field.getTagByName( COMPONENT );
+ DocletTag componentTag = field.getTagByName( JavaMojoAnnotation.COMPONENT );
if ( componentTag != null )
{
- String role = componentTag.getNamedParameter( COMPONENT_ROLE );
+ String role = componentTag.getNamedParameter( JavaMojoAnnotation.COMPONENT_ROLE );
if ( role == null )
{
role = field.getType().toString();
}
- String roleHint = componentTag.getNamedParameter( COMPONENT_ROLEHINT );
+ String roleHint = componentTag.getNamedParameter( JavaMojoAnnotation.COMPONENT_ROLEHINT );
if ( roleHint == null )
{
@@ -486,7 +477,7 @@
}
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
@@ -498,7 +489,7 @@
// 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 ) )
{
@@ -509,40 +500,40 @@
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 )
{
pd.setDeprecated( deprecationTag.getValue() );
}
- DocletTag sinceTag = field.getTagByName( SINCE );
+ DocletTag sinceTag = field.getTagByName( JavaMojoAnnotation.SINCE );
if ( sinceTag != null )
{
pd.setSince( sinceTag.getValue() );
}
- String alias = parameter.getNamedParameter( PARAMETER_ALIAS );
+ String alias = parameter.getNamedParameter( JavaMojoAnnotation.PARAMETER_ALIAS );
if ( !StringUtils.isEmpty( alias ) )
{
pd.setAlias( alias );
}
- pd.setExpression( parameter.getNamedParameter( PARAMETER_EXPRESSION ) );
+ pd.setExpression( parameter.getNamedParameter( JavaMojoAnnotation.PARAMETER_EXPRESSION ) );
if ( "${reports}".equals( pd.getExpression() ) )
{
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 );
@@ -574,7 +565,7 @@
{
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 );
}