Interface UpgradeOptions

All Superinterfaces:
Options
All Known Implementing Classes:
CommonsCliUpgradeOptions

@Experimental public interface UpgradeOptions extends Options
Defines the options specific to the Maven upgrade tool. This interface extends the general Options interface, adding upgrade-specific configuration options.
Since:
4.0.0
  • Method Details

    • force

      Optional<Boolean> force()
      Should the operation be forced (ie overwrite existing files, if any).
      Returns:
      an Optional containing the boolean value true if specified, or empty
    • yes

      Should imply "yes" to all questions.
      Returns:
      an Optional containing the boolean value true if specified, or empty
    • goals

      Returns the list of upgrade goals to be executed. These goals can include operations like "check", "dependencies", "plugins", etc.
      Returns:
      an Optional containing the list of goals, or empty if not specified
    • modelVersion

      @Nonnull Optional<String> modelVersion()
      Returns the target POM model version for upgrades. Supported values include "4.0.0" and "4.1.0".
      Returns:
      an Optional containing the model version, or empty if not specified
    • directory

      @Nonnull Optional<String> directory()
      Returns the directory to use as starting point for POM discovery. If not specified, the current directory will be used.
      Returns:
      an Optional containing the directory path, or empty if not specified
    • infer

      Should use inference when upgrading (remove redundant information).
      Returns:
      an Optional containing the boolean value true if specified, or empty
    • model

      Should fix Maven 4 compatibility issues in POMs. This includes fixing unsupported combine attributes, duplicate dependencies, unsupported expressions, and other Maven 4 validation issues.
      Returns:
      an Optional containing the boolean value true if specified, or empty
    • plugins

      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.
      Returns:
      an Optional containing the boolean value true if specified, or empty
    • all

      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.
      Returns:
      an Optional containing the boolean value true if specified, or empty