Class ModelUpgradeStrategy

java.lang.Object
org.apache.maven.cling.invoker.mvnup.goals.AbstractUpgradeStrategy
org.apache.maven.cling.invoker.mvnup.goals.ModelUpgradeStrategy
All Implemented Interfaces:
UpgradeStrategy

@Named @Singleton @Priority(40) public class ModelUpgradeStrategy extends AbstractUpgradeStrategy
Strategy for upgrading Maven model versions (e.g., 4.0.0 → 4.1.0). Handles namespace updates, schema location changes, and element conversions.
  • Constructor Details

    • ModelUpgradeStrategy

      public ModelUpgradeStrategy()
  • Method Details

    • isApplicable

      public boolean isApplicable(UpgradeContext context)
      Description copied from interface: UpgradeStrategy
      Checks if this strategy is applicable given the current options.
      Parameters:
      context - the upgrade context
      Returns:
      true if this strategy should be applied
    • getDescription

      public String getDescription()
      Description copied from interface: UpgradeStrategy
      Gets a description of what this strategy does.
      Returns:
      a human-readable description of the strategy
    • doApply

      public UpgradeResult doApply(UpgradeContext context, Map<Path, org.jdom2.Document> pomMap)
      Description copied from class: AbstractUpgradeStrategy
      Subclasses implement the actual upgrade logic here.
      Specified by:
      doApply in class AbstractUpgradeStrategy
      Parameters:
      context - the upgrade context
      pomMap - map of all POM files in the project
      Returns:
      the result of the upgrade operation