Annotation Interface Mojo


This annotation will mark your class as a Mojo (ie. goal in a Maven plugin). The mojo can be annotated with jakarta.inject.* annotations. The Parameter annotation can be added on fields to inject data from the plugin configuration or from other components.
Since:
4.0.0
  • Required Element Summary

    Required Elements
    Modifier and Type
    Required Element
    Description
    goal name (required).
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    boolean
    if the Mojo uses the Maven project and its child modules.
    TODO: v4: add a SPI for the configurator configurator bean name.
    default phase to bind your mojo.
    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

      @Nonnull String defaultPhase
      default phase to bind your mojo.
      Returns:
      the default phase
      Default:
      ""
    • projectRequired

      boolean projectRequired
      does your mojo requires a project to be executed?
      Returns:
      requires a project
      Default:
      true
    • aggregator

      boolean aggregator
      if the Mojo uses the Maven project and its child modules.
      Returns:
      uses the Maven project and its child modules
      Default:
      false
    • onlineRequired

      boolean onlineRequired
      does this Mojo need to be online to be executed?
      Returns:
      need to be online
      Default:
      false
    • configurator

      @Nonnull String configurator
      TODO: v4: add a SPI for the configurator configurator bean name.
      Returns:
      the configurator bean name
      Default:
      ""