Package org.apache.maven.api.cli
Interface Options
- All Known Subinterfaces:
EncryptOptions
,MavenOptions
- All Known Implementing Classes:
CommonsCliEncryptOptions
,CommonsCliMavenOptions
,CommonsCliOptions
,LayeredMavenOptions
,LayeredOptions
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 Summary
Modifier and TypeFieldDescriptionstatic final String
Constant indicating that the options source is the command-line interface. -
Method Summary
Modifier and TypeMethodDescriptionReturns the path to an alternate installation settings file.Returns the path to an alternate installation toolchains file.Returns the path to an alternate project settings file.Returns the path to an alternate user settings file.Returns the path to an alternate user toolchains file.color()
Returns the color setting for console output.void
displayHelp
(ParserRequest request, Consumer<String> printWriter) Displays help information for these options.Returns the severity level at which the build should fail.Indicates whether to force interactive mode.help()
Indicates whether to show help information.interpolate
(Collection<Map<String, String>> properties) Returns a new instance ofOptions
with values interpolated using the given properties.logFile()
Returns the path to the log file.Indicates whether to run in non-interactive mode.quiet()
Indicates whether to run in quiet mode.Returns whether raw streams should be logged.Indicates whether to show error stack traces.Indicates whether to show the version information.Indicates whether to show the version information and exit.source()
Returns a simple designator of the options source, such as "cli", "maven.conf", etc.Returns the user-defined properties for the Maven execution.verbose()
Indicates whether to run in verbose mode.default void
warnAboutDeprecatedOptions
(ParserRequest request, Consumer<String> printWriter) Emits warning messages if deprecated options are used.
-
Field Details
-
SOURCE_CLI
Constant indicating that the options source is the command-line interface.- See Also:
-
-
Method Details
-
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
Returns the user-defined properties for the Maven execution.- Returns:
- an
Optional
containing the map of user properties, or empty if not set
-
showVersionAndExit
Indicates whether to show the version information and exit.- Returns:
- an
Optional
containing the boolean flag, or empty if not set
-
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
Indicates whether to show error stack traces.- Returns:
- an
Optional
containing the boolean flag, or empty if not set
-
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
Indicates whether to run in non-interactive mode.- Returns:
- an
Optional
containing the boolean flag, or empty if not set
-
forceInteractive
Indicates whether to force interactive mode.- Returns:
- an
Optional
containing the boolean flag, or empty if not set
-
altUserSettings
Returns the path to an alternate user settings file.- Returns:
- an
Optional
containing the file path, or empty if not set
-
altProjectSettings
Returns the path to an alternate project settings file.- Returns:
- an
Optional
containing the file path, or empty if not set
-
altInstallationSettings
Returns the path to an alternate installation settings file.- Returns:
- an
Optional
containing the file path, or empty if not set
-
altUserToolchains
Returns the path to an alternate user toolchains file.- Returns:
- an
Optional
containing the file path, or empty if not set
-
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
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
Returns a new instance ofOptions
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
Displays help information for these options.- Parameters:
printWriter
- the string consumer to use for output
-