Skip to main content

Upgrade plugins that are incompatible with Maven 4

org.openrewrite.maven.UpgradePluginsForMaven4

Upgrades plugins that are known to fail under Maven 4, using the minimum working versions applied by Apache's own mvnup upgrade --plugins as a floor while accepting any newer release within the same major version. Plugins already at or above that floor are upgraded to the latest such release; plugins that declare no version are left alone. quarkus-maven-plugin is held at its floor, as its version is coupled to the Quarkus platform BOM. Plugin dependencies known to break Maven 4 are upgraded as well.

Recipe source

GitHub: maven.yml, Issue Tracker, Code Genome Project

info

This recipe is composed of more than one recipe. If you want to customize the set of recipes this is composed of, you can find and copy the GitHub source for the recipe from the link above.

This recipe is available under the Apache License Version 2.0.

Definition

Used by

This recipe is used as part of the following composite recipes:

Usage

This recipe has no required configuration parameters and comes from a rewrite core library. It can be activated directly without adding any dependencies.

OpenRewrite artifacts are distributed through the Code Genome Project repository (https://artifacts.codegenomeproject.org/maven), which requires authentication. Sign in to the Code Genome Project to create a download token, then in the snippets below replace USERNAME with the email or username you signed in with and TOKEN with that token. See the quickstart guide for details.

  1. Add the Code Genome Project credentials to your Maven settings.xml file (typically at ~/.m2/settings.xml):
    settings.xml
    <settings>
    <servers>
    <server>
    <id>codegenome</id>
    <username>USERNAME</username>
    <password>TOKEN</password>
    </server>
    </servers>
    </settings>
  2. Add the following to your pom.xml file:
    pom.xml
    <project>
    <repositories>
    <repository>
    <id>codegenome</id>
    <url>https://artifacts.codegenomeproject.org/maven</url>
    </repository>
    </repositories>
    <pluginRepositories>
    <pluginRepository>
    <id>codegenome</id>
    <url>https://artifacts.codegenomeproject.org/maven</url>
    </pluginRepository>
    </pluginRepositories>
    <build>
    <plugins>
    <plugin>
    <groupId>org.openrewrite.maven</groupId>
    <artifactId>rewrite-maven-plugin</artifactId>
    <version>6.45.0</version>
    <configuration>
    <exportDatatables>true</exportDatatables>
    <activeRecipes>
    <recipe>org.openrewrite.maven.UpgradePluginsForMaven4</recipe>
    </activeRecipes>
    </configuration>
    </plugin>
    </plugins>
    </build>
    </project>
  3. Run mvn rewrite:run to run the recipe.

See how this recipe works across multiple open-source repositories

Run this recipe on OSS repos at scale with the Moderne SaaS.

The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories.

Please contact Moderne for more information about safely running the recipes on your own codebase in a private SaaS.

Data Tables

Maven metadata failures

org.openrewrite.maven.table.MavenMetadataFailures

Attempts to resolve maven metadata that failed.

Column NameDescription
Group idThe groupId of the artifact for which the metadata download failed.
Artifact idThe artifactId of the artifact for which the metadata download failed.
VersionThe version of the artifact for which the metadata download failed.
Maven repositoryThe URL of the Maven repository that the metadata download failed on.
SnapshotsDoes the repository support snapshots.
ReleasesDoes the repository support releases.
FailureThe reason the metadata download failed.