Skip to content

Upgrade maven-pmd-plugin as part of the Java 17 migration - #1208

Merged
timtebeek merged 1 commit into
mainfrom
tim/maven-pmd-plugin-upgrade
Aug 17, 2026
Merged

Upgrade maven-pmd-plugin as part of the Java 17 migration#1208
timtebeek merged 1 commit into
mainfrom
tim/maven-pmd-plugin-upgrade

Conversation

@timtebeek

Copy link
Copy Markdown
Member

What's changed?

Moves the maven-pmd-plugin upgrade from UpgradePluginsForJava25 to UpgradePluginsForJava17, using the floating 3.x version already used there for maven-checkstyle-plugin, maven-compiler-plugin and maven-war-plugin.

Since UpgradeToJava25UpgradeToJava21UpgradeToJava17, the Java 25 floor of 3.28.x stays covered; keeping both entries would just be two sources of truth for the same plugin, with the pin being the lower of the two.

What's your motivation?

Reported by a customer running the Spring Boot 4 migration (which pulls in UpgradeToJava17): they still had to hand-bump maven-pmd-plugin 3.24.0 → 3.28.0 afterwards to get past a StackOverflowError in PMD. Pinning the bump to the Java 25 recipe only catches folks going all the way to 25; floating it at the Java 17 level catches PMD parser and analyzer fixes for everyone landing on Java 17 or later.

Anything in particular you'd like reviewers to focus on?

maven-pmd-plugin 3.22.0 switched from PMD 6.55 to PMD 7.0, so projects still pinned below 3.22 get a major analyzer change: PMD 7 renamed/removed rules and dropped the old rulesets/java/*.xml paths, so custom rulesets can fail to load and pmd:check can newly fail. UpgradePluginVersion has no way to gate on "only if current >= 3.22", and the maven-checkstyle-plugin: 3.x entry already in this recipe accepts the same class of risk, so this seems acceptable — but worth a second opinion.

Compatibility checked: 3.28.0 still declares <javaVersion>8</javaVersion> and <prerequisites><maven>3.6.3</maven></prerequisites>, so no new build floor is imposed.

Move the `maven-pmd-plugin` upgrade from `UpgradePluginsForJava25` to
`UpgradePluginsForJava17`, so that anyone landing on Java 17 or later
picks up PMD parser and analyzer fixes. `UpgradeToJava25` chains through
`UpgradeToJava21` and `UpgradeToJava17`, so the Java 25 floor of 3.28.x
remains covered by the floating `3.x` version.
@github-project-automation github-project-automation Bot moved this to In Progress in OpenRewrite Aug 17, 2026
@timtebeek
timtebeek merged commit 4a91085 into main Aug 17, 2026
1 check passed
@timtebeek
timtebeek deleted the tim/maven-pmd-plugin-upgrade branch August 17, 2026 19:57
@github-project-automation github-project-automation Bot moved this from In Progress to Done in OpenRewrite Aug 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant