Annotation Interface Mojo
This annotation will mark your class as a Mojo, which is the implementation of a goal in a Maven plugin.
The mojo can be annotated with org.apache.maven.api.di.*
annotations to
control the lifecycle of the mojo itself, and to inject other beans.
The mojo class can also be injected with an Execute
annotation to specify a
forked lifecycle.
The Parameter
annotation can be added on fields to inject data
from the plugin configuration or from other components.
Fields can also be annotated with the Resolution
annotation to be injected
with the dependency collection or resolution result for the project.
- Since:
- 4.0.0
-
Required Element Summary
-
Optional Element Summary
Modifier and TypeOptional ElementDescriptionboolean
if the Mojo uses the Maven project and its subprojects.TODO: v4: add a SPI for the configurator configurator bean name.default phase to bind your mojo.boolean
Indicates whether dependency collection will be required when executing the Mojo.Comma separated list of path scopes that will be required for dependency resolution.boolean
does this Mojo need to be online to be executed?boolean
does your mojo requires a project to be executed?
-
Element Details
-
name
goal name (required).- Returns:
- the goal name
-
defaultPhase
default phase to bind your mojo.- Returns:
- the default phase
- Default:
""
-
projectRequired
boolean projectRequireddoes your mojo requires a project to be executed?- Returns:
- requires a project
- Default:
true
-
aggregator
boolean aggregatorif the Mojo uses the Maven project and its subprojects.- Returns:
- uses the Maven project and its subprojects
- Default:
false
-
onlineRequired
boolean onlineRequireddoes this Mojo need to be online to be executed?- Returns:
- need to be online
- Default:
false
-
configurator
TODO: v4: add a SPI for the configurator configurator bean name.- Returns:
- the configurator bean name
- Default:
""
-
dependencyCollection
Indicates whether dependency collection will be required when executing the Mojo. If not set, it will be inferred from the fields annotated with theResolution
annotation.- Default:
false
-
dependencyResolutionPathScopes
Comma separated list of path scopes that will be required for dependency resolution. If not set, it will be inferred from the fields annotated with theResolution
annotation.- Default:
""
-