Interface UpgradeStrategy

All Known Implementing Classes:
AbstractUpgradeStrategy, CompatibilityFixStrategy, InferenceStrategy, ModelUpgradeStrategy, PluginUpgradeStrategy

public interface UpgradeStrategy
Strategy interface for different types of upgrade operations. Each strategy handles a specific aspect of the Maven upgrade process.
  • Method Summary

    Modifier and Type
    Method
    Description
    apply(UpgradeContext context, Map<Path, org.jdom2.Document> pomMap)
    Applies the upgrade strategy to all eligible POMs.
    Gets a description of what this strategy does.
    boolean
    Checks if this strategy is applicable given the current options.
    default boolean
    isOptionEnabled(UpgradeOptions options, Optional<Boolean> specificOption, boolean defaultWhenNoOptionsSpecified)
    Helper method to check if a specific option is enabled, considering --all flag and defaults.
  • Method Details

    • apply

      UpgradeResult apply(UpgradeContext context, Map<Path, org.jdom2.Document> pomMap)
      Applies the upgrade strategy to all eligible POMs.
      Parameters:
      context - the upgrade context
      pomMap - map of all POM files in the project
      Returns:
      the result of the upgrade operation
    • isApplicable

      boolean isApplicable(UpgradeContext context)
      Checks if this strategy is applicable given the current options.
      Parameters:
      context - the upgrade context
      Returns:
      true if this strategy should be applied
    • isOptionEnabled

      default boolean isOptionEnabled(UpgradeOptions options, Optional<Boolean> specificOption, boolean defaultWhenNoOptionsSpecified)
      Helper method to check if a specific option is enabled, considering --all flag and defaults.
      Parameters:
      options - the upgrade options
      specificOption - the specific option to check
      defaultWhenNoOptionsSpecified - whether this option should be enabled by default
      Returns:
      true if the option should be enabled
    • getDescription

      String getDescription()
      Gets a description of what this strategy does.
      Returns:
      a human-readable description of the strategy