Class CommonsCliUpgradeOptions
java.lang.Object
org.apache.maven.cling.invoker.CommonsCliOptions
org.apache.maven.cling.invoker.mvnup.CommonsCliUpgradeOptions
- All Implemented Interfaces:
UpgradeOptions
,Options
Implementation of
UpgradeOptions
(base + mvnup).-
Nested Class Summary
Nested Classes -
Field Summary
Fields inherited from class org.apache.maven.cling.invoker.CommonsCliOptions
cliManager, commandLine, source
Fields inherited from interface org.apache.maven.api.cli.Options
SOURCE_CLI
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
CommonsCliUpgradeOptions
(String source, CommonsCliUpgradeOptions.CLIManager cliManager, org.apache.commons.cli.CommandLine commandLine) -
Method Summary
Modifier and TypeMethodDescriptionall()
Should apply all upgrade options (equivalent to --model-version 4.1.0 --infer --model --plugins).protected CommonsCliUpgradeOptions
copy
(String source, CommonsCliOptions.CLIManager cliManager, org.apache.commons.cli.CommandLine commandLine) Returns the directory to use as starting point for POM discovery.void
displayHelp
(ParserRequest request, Consumer<String> printStream) Displays help information for these options.force()
Should the operation be forced (ie overwrite existing files, if any).goals()
Returns the list of upgrade goals to be executed.infer()
Should use inference when upgrading (remove redundant information).model()
Should fix Maven 4 compatibility issues in POMs.Returns the target POM model version for upgrades.static CommonsCliUpgradeOptions
plugins()
Should upgrade plugins known to fail with Maven 4 to their minimum compatible versions.yes()
Should imply "yes" to all questions.Methods inherited from class org.apache.maven.cling.invoker.CommonsCliOptions
altInstallationSettings, altInstallationToolchains, altProjectSettings, altUserSettings, altUserToolchains, color, failOnSeverity, forceInteractive, help, interpolate, logFile, nonInteractive, offline, parse, quiet, rawStreams, showErrors, showVersion, showVersionAndExit, source, userProperties, verbose, warnAboutDeprecatedOptions
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.apache.maven.api.cli.Options
altInstallationSettings, altInstallationToolchains, altProjectSettings, altUserSettings, altUserToolchains, color, failOnSeverity, forceInteractive, help, interpolate, logFile, nonInteractive, offline, quiet, rawStreams, showErrors, showVersion, showVersionAndExit, source, userProperties, verbose, warnAboutDeprecatedOptions
-
Constructor Details
-
CommonsCliUpgradeOptions
protected CommonsCliUpgradeOptions(String source, CommonsCliUpgradeOptions.CLIManager cliManager, org.apache.commons.cli.CommandLine commandLine)
-
-
Method Details
-
parse
public static CommonsCliUpgradeOptions parse(String[] args) throws org.apache.commons.cli.ParseException - Throws:
org.apache.commons.cli.ParseException
-
force
Description copied from interface:UpgradeOptions
Should the operation be forced (ie overwrite existing files, if any).- Specified by:
force
in interfaceUpgradeOptions
- Returns:
- an
Optional
containing the boolean valuetrue
if specified, or empty
-
yes
Description copied from interface:UpgradeOptions
Should imply "yes" to all questions.- Specified by:
yes
in interfaceUpgradeOptions
- Returns:
- an
Optional
containing the boolean valuetrue
if specified, or empty
-
goals
Description copied from interface:UpgradeOptions
Returns the list of upgrade goals to be executed. These goals can include operations like "check", "dependencies", "plugins", etc.- Specified by:
goals
in interfaceUpgradeOptions
- Returns:
- an
Optional
containing the list of goals, or empty if not specified
-
modelVersion
Description copied from interface:UpgradeOptions
Returns the target POM model version for upgrades. Supported values include "4.0.0" and "4.1.0".- Specified by:
modelVersion
in interfaceUpgradeOptions
- Returns:
- an
Optional
containing the model version, or empty if not specified
-
directory
Description copied from interface:UpgradeOptions
Returns the directory to use as starting point for POM discovery. If not specified, the current directory will be used.- Specified by:
directory
in interfaceUpgradeOptions
- Returns:
- an
Optional
containing the directory path, or empty if not specified
-
infer
Description copied from interface:UpgradeOptions
Should use inference when upgrading (remove redundant information).- Specified by:
infer
in interfaceUpgradeOptions
- Returns:
- an
Optional
containing the boolean valuetrue
if specified, or empty
-
model
Description copied from interface:UpgradeOptions
Should fix Maven 4 compatibility issues in POMs. This includes fixing unsupported combine attributes, duplicate dependencies, unsupported expressions, and other Maven 4 validation issues.- Specified by:
model
in interfaceUpgradeOptions
- Returns:
- an
Optional
containing the boolean valuetrue
if specified, or empty
-
plugins
Description copied from interface:UpgradeOptions
Should upgrade plugins known to fail with Maven 4 to their minimum compatible versions. This includes upgrading plugins like maven-exec-plugin, maven-enforcer-plugin, flatten-maven-plugin, and maven-shade-plugin to versions that work with Maven 4.- Specified by:
plugins
in interfaceUpgradeOptions
- Returns:
- an
Optional
containing the boolean valuetrue
if specified, or empty
-
all
Description copied from interface:UpgradeOptions
Should apply all upgrade options (equivalent to --model-version 4.1.0 --infer --model --plugins). This is a convenience option that combines model upgrade, inference, compatibility fixes, and plugin upgrades.- Specified by:
all
in interfaceUpgradeOptions
- Returns:
- an
Optional
containing the boolean valuetrue
if specified, or empty
-
displayHelp
Description copied from interface:Options
Displays help information for these options.- Specified by:
displayHelp
in interfaceOptions
- Overrides:
displayHelp
in classCommonsCliOptions
- Parameters:
printStream
- the string consumer to use for output
-
copy
protected CommonsCliUpgradeOptions copy(String source, CommonsCliOptions.CLIManager cliManager, org.apache.commons.cli.CommandLine commandLine) - Overrides:
copy
in classCommonsCliOptions
-