Annotation Type Parameter


  • @Documented
    @Retention(CLASS)
    @Target(FIELD)
    @Inherited
    public @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:
    3.0
    Author:
    Olivier Lamy
    • Optional Element Summary

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

      • name

        java.lang.String 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

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

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

        java.lang.String defaultValue
        parameter default value, eventually containing ${...} 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