Annotation Interface Parameter


Used to configure your Mojo parameters to be injected by MavenPluginManager.getConfiguredMojo(...).

Beans injected into Mojo parameters are prepared by Sisu JSR330-based container: this annotation is only effective on fields of the Mojo class itself, nested bean injection requires Sisu or JSR330 annotations.

Since:
4.0.0
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    alias supported to get parameter value.
    parameter default value, may contain ${...} expressions which will be interpreted at inject time: see PluginParameterExpressionEvaluator.
    name of the bean property used to get/set the field: by default, field name is used.
    Property to use to retrieve a value.
    boolean
    Specifies that this parameter cannot be configured directly by the user (as in the case of POM-specified configuration).
    boolean
    is the parameter required?
  • Element Details

    • name

      name of the bean property used to get/set the field: by default, field name is used.
      Returns:
      the name of the bean property
      Default:
      ""
    • alias

      alias supported to get parameter value.
      Returns:
      the alias
      Default:
      ""
    • property

      @Nonnull String property
      Property to use to retrieve a value. Can come from -D execution, setting properties or pom properties.
      Returns:
      property name
      Default:
      ""
    • defaultValue

      @Nonnull String defaultValue
      parameter default value, may contain ${...} expressions which will be interpreted at inject time: see PluginParameterExpressionEvaluator.
      Returns:
      the default value
      Default:
      ""
    • required

      boolean required
      is the parameter required?
      Returns:
      true if the Mojo should fail when the parameter cannot be injected
      Default:
      false
    • readonly

      boolean readonly
      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.
      Returns:
      true if the user should not be allowed to configure the parameter directly
      Default:
      false