Migrate to Maven 4

Apache 2.0

Migrates Maven POMs from Maven 3 to Maven 4, addressing breaking changes and deprecations. This recipe updates property expressions, runs the Maven 3.10 migration (which removes duplicate plugin and dependency declarations, fixes invalid parent relative paths, updates an existing Maven wrapper to Maven 3.10, and removes properties that equal the new super POM defaults), updates lifecycle phases, upgrades plugins known to fail under Maven 4, switches repository URLs to HTTPS, and replaces removed properties to ensure compatibility with Maven 4.

org.openrewrite.maven.MigrateToMaven4
mod run . --recipe=org.openrewrite.maven.MigrateToMaven4

Install it once from Recipe actions, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.

Recipe list

It runs these recipes, in this order.

  1. Drop prefixless expressions in POM
  2. Migrate to Maven 3.10
  3. Replace removed root directory properties
  4. Replace deprecated lifecycle phases
  5. Use HTTPS for repositories
  6. Upgrade plugins that are incompatible with Maven 4
  7. Upgrade to Maven model version 4.1.0
  8. Replace modules with subprojects