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, sourceFields inherited from interface org.apache.maven.api.cli.Options
SOURCE_CLI -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedCommonsCliUpgradeOptions(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 CommonsCliUpgradeOptionscopy(String source, CommonsCliOptions.CLIManager cliManager, org.apache.commons.cli.CommandLine commandLine) Returns the directory to use as starting point for POM discovery.voiddisplayHelp(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 CommonsCliUpgradeOptionsplugins()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, warnAboutDeprecatedOptionsMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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:UpgradeOptionsShould the operation be forced (ie overwrite existing files, if any).- Specified by:
forcein interfaceUpgradeOptions- Returns:
- an
Optionalcontaining the boolean valuetrueif specified, or empty
-
yes
Description copied from interface:UpgradeOptionsShould imply "yes" to all questions.- Specified by:
yesin interfaceUpgradeOptions- Returns:
- an
Optionalcontaining the boolean valuetrueif specified, or empty
-
goals
Description copied from interface:UpgradeOptionsReturns the list of upgrade goals to be executed. These goals can include operations like "check", "dependencies", "plugins", etc.- Specified by:
goalsin interfaceUpgradeOptions- Returns:
- an
Optionalcontaining the list of goals, or empty if not specified
-
modelVersion
Description copied from interface:UpgradeOptionsReturns the target POM model version for upgrades. Supported values include "4.0.0" and "4.1.0".- Specified by:
modelVersionin interfaceUpgradeOptions- Returns:
- an
Optionalcontaining the model version, or empty if not specified
-
directory
Description copied from interface:UpgradeOptionsReturns the directory to use as starting point for POM discovery. If not specified, the current directory will be used.- Specified by:
directoryin interfaceUpgradeOptions- Returns:
- an
Optionalcontaining the directory path, or empty if not specified
-
infer
Description copied from interface:UpgradeOptionsShould use inference when upgrading (remove redundant information).- Specified by:
inferin interfaceUpgradeOptions- Returns:
- an
Optionalcontaining the boolean valuetrueif specified, or empty
-
model
Description copied from interface:UpgradeOptionsShould 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:
modelin interfaceUpgradeOptions- Returns:
- an
Optionalcontaining the boolean valuetrueif specified, or empty
-
plugins
Description copied from interface:UpgradeOptionsShould 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:
pluginsin interfaceUpgradeOptions- Returns:
- an
Optionalcontaining the boolean valuetrueif specified, or empty
-
all
Description copied from interface:UpgradeOptionsShould 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:
allin interfaceUpgradeOptions- Returns:
- an
Optionalcontaining the boolean valuetrueif specified, or empty
-
displayHelp
Description copied from interface:OptionsDisplays help information for these options.- Specified by:
displayHelpin interfaceOptions- Overrides:
displayHelpin 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:
copyin classCommonsCliOptions
-