Class InferenceStrategy

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

@Named @Singleton @Priority(30) public class InferenceStrategy extends AbstractUpgradeStrategy
Strategy for applying Maven inference optimizations. For 4.0.0 models: applies limited inference (parent-related only). For 4.1.0+ models: applies full inference optimizations. Removes redundant information that can be inferred by Maven during model building.
  • Constructor Details

    • InferenceStrategy

      public InferenceStrategy()
  • 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