Class RepositoryHttpsUpgradeStrategy

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

@Named @Singleton @Priority(15) public class RepositoryHttpsUpgradeStrategy extends AbstractUpgradeStrategy
Strategy for upgrading HTTP repository URLs to HTTPS in POM files.

Since Maven 3.8.1+, HTTP repositories are blocked by the maven-default-http-blocker mirror, so any http:// repository URL will cause build failures. This strategy automatically converts http:// URLs to https://, using canonical HTTPS URLs for well-known repositories.

The strategy handles:

  • <repositories>/<repository> URLs
  • <pluginRepositories>/<pluginRepository> URLs
  • <distributionManagement>/<repository> and <snapshotRepository> URLs
  • Profile-scoped repositories in all of the above sections
  • Constructor Details

    • RepositoryHttpsUpgradeStrategy

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

      protected UpgradeResult doApply(UpgradeContext context, Map<Path, eu.maveniverse.domtrip.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