Annotation Interface PluginTaskParameter


@Documented @Retention(CLASS) @Target(FIELD) public @interface PluginTaskParameter
An annotation that configures a parameter for plugin task. Should be inside a type annotated with PluginTask.

The annotation is used during generation of particular plugin implementations, like Maven Mojos or Gradle Tasks.

Java primitives, strings, lists, maps, enums and simple records/POJOs are supported.

Since:
1.0.x
Author:
Andriy Dmytruk
  • Element Details

    • required

      boolean required
      Whether the parameter is required. By default, parameters are not required to ensure a simple plugin API. Parameters that have a default value should not be required.
      Returns:
      Whether it is required
      Default:
      false
    • defaultValue

      String defaultValue
      The default value. Is allowed only for Java primitives or enums.
      Returns:
      The default value
      Default:
      ""
    • internal

      boolean internal
      Whether the parameter is plugin-internal. This means that the parameter won't get exposed as part of plugin API. Specific logic will be written by developer in plugin to set the value for this parameter. This is useful for parameters that depend on plugin-specific logic, like getting the build directory.
      Returns:
      Whether it is internal
      Default:
      false
    • globalProperty

      String globalProperty
      The global property name. For maven Mojo it will correspond to @Parameter(property='') value. It has no current effect for Gradle.
      Returns:
      The property name
      Default:
      ""
    • directory

      boolean directory
      Whether the file is a directory. Will only work for parameters of type File.
      Returns:
      Whether it is a directory.
      Default:
      false
    • output

      Whether the parameter is output of the task. Most likely, the parameter is a file or directory.
      Returns:
      Whether it is output and what type of output it is
      Default:
      NONE
    • pathSensitivity

      Returns:
      Path sensitivity to use for file parameters. This would reflect on how task executions are cached. If the path is considered equal, task won't be executed again. This has no effect for Maven.
      Default:
      ABSOLUTE