Package org.apache.maven.tools.plugin.javadoc

See: Description

Package org.apache.maven.tools.plugin.javadoc Description

Mojo Javadoc Tags used by Maven Plugins

Here is a reference of the Javadoc annotations that can be used to 'decorate' the Java sources to allow Mojo to generate descriptors.

Annotations specified at the class level

Descriptor Element Annotation Required? Notes
aggregator @aggregator No Flags this Mojo to run it in a multi module way, i.e. aggregate the build with the set of projects listed as modules.
configurator @configurator <roleHint> No 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. NOTE: This will only be used in very special cases, using a highly controlled vocabulary of possible values. (Elements like this are why it's a good idea to use the descriptor tools.)
execute
  • @execute phase="<phaseName>" lifecycle="<lifecycleId>"
  • @execute phase="<phaseName>"
  • @execute goal="<goalName>"
No When this goal is invoked, it will first invoke a parallel lifecycle, ending at the given phase. If a goal is provided instead of a phase, that goal will be executed in isolation. The execution of either will not affect the current project, but instead make available the ${executedProject} expression if required. An alternate lifecycle can also be provided: for more information see the documentation on the build lifecycle.
executionStrategy @executionStrategy <strategy> No Specify the execution strategy. NOTE: Currently supports once-per-session, always.
goal @goal <goalName> Yes The name for the Mojo that users will reference from the command line to execute the Mojo directly, or inside a POM in order to provide Mojo-specific configuration.
inheritByDefault @inheritByDefault <true|false> No. Default: true Specify that the Mojo is inherited.
instantiationStrategy @instantiationStrategy <per-lookup> No. Default: per-lookup Specify the instantiation strategy.
phase @phase <phaseName> No Binds this Mojo to a particular phase of the standard build lifecycle, if specified. NOTE: This is only required if this Mojo is to participate in the standard build process.
requiresDependencyResolution @requiresDependencyResolution <requiredScope> No Flags this Mojo as requiring the dependencies in the specified scope (or an implied scope) to be resolved before it can execute. NOTE: Currently supports compile , runtime , and test scopes.
requiresDirectInvocation @requiresDirectInvocation <true|false> No. Default: false Flags this Mojo to be invoke directly.
requiresOnline @requiresOnline <true|false> No. Default: true Flags this Mojo to be run in online mode.
requiresProject @requiresProject <true|false> No. Default: true Flags this Mojo to run inside of a project.
requiresReports @requiresReports <true|false> No. Default: false Flags this Mojo to require reports.
description none (detected) No The description of this Mojo's functionality. Using the toolset, this will be the class-level Javadoc description provided. NOTE: While this is not a required part of the Mojo specification, it SHOULD be provided to enable future tool support for browsing, etc. and for clarity.
implementation none (detected) Yes The Mojo's fully-qualified class name (or script path in the case of non-Java Mojos).
language none (detected) No. Default: java The implementation language for this Mojo (Java, beanshell, etc.).
deprecated @deprecated <deprecated-text> No Specify the version when the Mojo was deprecated to the API. Similar to Javadoc deprecated. This will trigger a warning when a user tries to configure a parameter marked as deprecated.
since @since <since-text> No Specify the version when the Mojo was added to the API. Similar to Javadoc since.

Annotations specified at the field level

Descriptor Element Annotation Required? Notes
alias @parameter alias="myAlias" No Specifies an alias which can be used to configure this parameter from the POM. This is primarily useful to improve user-friendliness, where Mojo field names are not intuitive to the user or are otherwise not conducive to configuration via the POM.
configuration @component role="..." roleHint="..." No Populates the field with an instance of a Plexus component. This is like declaring a requirement in a Plexus component. The default requirement will have a role equal to the declared type of the field, and will use the default role hint. You can customise either of these by providing a role and/or roleHint parameter. e.g. @component role="org.apache.maven.artifact.ArtifactHandler" roleHint="ear"Note: This is identical to the deprecated form of parameter: @parameter expression="${component.yourpackage.YourComponentClass}".
configuration @parameter expression="${someExpression}" default-value="value" No Specifies the expression used to calculate the value to be injected into this parameter of the Mojo at buildtime. This is commonly used to refer to specific elements in the POM, such as ${project.build.resources}, which refers to the List of resources meant to accompany the classes in the resulting jar file. The default value is used when the expression evaluates to null . NOTE: If not specified, an expression of ${<name>} is assumed, which can only be satisfied from POM configuration or System properties. The use of '${' and '}' is required to delimit actual expressions which may be evaluated.
editable @readonly No Specifies that this parameter cannot be configured directly by the user (as in the case of POM-specified configuration). This is useful when you want to force the user to use common POM elements rather than plugin configurations, as in the case where you want to use the artifact's final name as a parameter. In this case, you want the user to modify <build><finalName/></build> rather than specifying a value for finalName directly in the plugin configuration section. It is also useful to ensure that - for example - a List-typed parameter which expects items of type Artifact doesn't get a List full of Strings. NOTE: Specification of this annotation flags the parameter as non-editable; there is no true/false value.
required @required No Whether this parameter is required for the Mojo to function. This is used to validate the configuration for a Mojo before it is injected, and before the Mojo is executed from some half-state. NOTE: Specification of this annotation flags the parameter as required; there is no true/false value.
description none (detected) No The description of this parameter's use inside the Mojo. Using the toolset, this is detected as the Javadoc description for the field. NOTE: While this is not a required part of the parameter specification, it SHOULD be provided to enable future tool support for browsing, etc. and for clarity.
name none (detected) Yes The name of the parameter, to be used in configuring this parameter from the Mojo's declared defaults (discussed below) or from the POM. Using the toolset, this is detected as the Java field name.
type none (detected) Yes The Java type for this parameter. This is used to validate the result of any expressions used to calculate the value which should be injected into the Mojo for this parameter. Using the toolset, this is detected as the class of the Java field corresponding to this parameter.
deprecated @deprecated <deprecated-text> No Specify the version when the Mojo was deprecated to the API. Similar to Javadoc deprecated. This will trigger a warning when a user tries to configure a parameter marked as deprecated.
since @since <since-text> No Specify the version when the Mojo was added to the API. Similar to Javadoc since.

Resources

Copyright © 2004–2018 The Apache Software Foundation. All rights reserved.