Interface Options

All Known Subinterfaces:
EncryptOptions, MavenOptions
All Known Implementing Classes:
CommonsCliEncryptOptions, CommonsCliMavenOptions, CommonsCliOptions, LayeredMavenOptions, LayeredOptions

@Experimental public interface Options
Represents the base options supported by Maven tools. This interface defines methods to access various configuration options that can be set through command-line arguments or configuration files.
Since:
4.0.0
  • Field Details

    • SOURCE_CLI

      static final String SOURCE_CLI
      Constant indicating that the options source is the command-line interface.
      See Also:
  • Method Details

    • source

      @Nonnull String source()
      Returns a simple designator of the options source, such as "cli", "maven.conf", etc.
      Returns:
      a string representing the source of the options
    • userProperties

      @Nonnull Optional<Map<String,String>> userProperties()
      Returns the user-defined properties for the Maven execution.
      Returns:
      an Optional containing the map of user properties, or empty if not set
    • showVersionAndExit

      @Nonnull Optional<Boolean> showVersionAndExit()
      Indicates whether to show the version information and exit.
      Returns:
      an Optional containing the boolean flag, or empty if not set
    • showVersion

      @Nonnull Optional<Boolean> showVersion()
      Indicates whether to show the version information.
      Returns:
      an Optional containing the boolean flag, or empty if not set
    • quiet

      Indicates whether to run in quiet mode.
      Returns:
      an Optional containing the boolean flag, or empty if not set
    • verbose

      Indicates whether to run in verbose mode.
      Returns:
      an Optional containing the boolean flag, or empty if not set
    • showErrors

      @Nonnull Optional<Boolean> showErrors()
      Indicates whether to show error stack traces.
      Returns:
      an Optional containing the boolean flag, or empty if not set
    • failOnSeverity

      @Nonnull Optional<String> failOnSeverity()
      Returns the severity level at which the build should fail.
      Returns:
      an Optional containing the fail-on-severity string, or empty if not set
    • nonInteractive

      @Nonnull Optional<Boolean> nonInteractive()
      Indicates whether to run in non-interactive mode.
      Returns:
      an Optional containing the boolean flag, or empty if not set
    • forceInteractive

      @Nonnull Optional<Boolean> forceInteractive()
      Indicates whether to force interactive mode.
      Returns:
      an Optional containing the boolean flag, or empty if not set
    • altUserSettings

      @Nonnull Optional<String> altUserSettings()
      Returns the path to an alternate user settings file.
      Returns:
      an Optional containing the file path, or empty if not set
    • altProjectSettings

      @Nonnull Optional<String> altProjectSettings()
      Returns the path to an alternate project settings file.
      Returns:
      an Optional containing the file path, or empty if not set
    • altInstallationSettings

      @Nonnull Optional<String> altInstallationSettings()
      Returns the path to an alternate installation settings file.
      Returns:
      an Optional containing the file path, or empty if not set
    • altUserToolchains

      @Nonnull Optional<String> altUserToolchains()
      Returns the path to an alternate user toolchains file.
      Returns:
      an Optional containing the file path, or empty if not set
    • altInstallationToolchains

      @Nonnull Optional<String> altInstallationToolchains()
      Returns the path to an alternate installation toolchains file.
      Returns:
      an Optional containing the file path, or empty if not set
    • logFile

      Returns the path to the log file.
      Returns:
      an Optional containing the file path, or empty if not set
    • rawStreams

      @Nonnull Optional<Boolean> rawStreams()
      Returns whether raw streams should be logged.
      Returns:
      a boolean indicating whether raw streams should be logged
    • color

      Returns the color setting for console output.
      Returns:
      an Optional containing the color setting, or empty if not set
    • help

      Indicates whether to show help information.
      Returns:
      an Optional containing the boolean flag, or empty if not set
    • interpolate

      @Nonnull Options interpolate(@Nonnull Collection<Map<String,String>> properties)
      Returns a new instance of Options with values interpolated using the given properties.
      Parameters:
      properties - a collection of property maps to use for interpolation
      Returns:
      a new Options instance with interpolated values
    • warnAboutDeprecatedOptions

      default void warnAboutDeprecatedOptions(@Nonnull ParserRequest request, @Nonnull Consumer<String> printWriter)
      Emits warning messages if deprecated options are used.
      Parameters:
      printWriter - the string consumer to use for output
    • displayHelp

      void displayHelp(@Nonnull ParserRequest request, @Nonnull Consumer<String> printWriter)
      Displays help information for these options.
      Parameters:
      printWriter - the string consumer to use for output