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

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
mergify Bot added a commit to robfrank/linklift that referenced this pull request Sep 6, 2026
…42.0 to 3.42.1 [skip ci]

Bumps [org.openrewrite.recipe:rewrite-migrate-java](https://github.com/openrewrite/rewrite-migrate-java) from 3.42.0 to 3.42.1.
Release notes

*Sourced from [org.openrewrite.recipe:rewrite-migrate-java's releases](https://github.com/openrewrite/rewrite-migrate-java/releases).*

> v3.42.1
> -------
>
> What's Changed
> --------------
>
> * Do not duplicate JSpecify annotations when several annotations map to one by [`@​timtebeek`](https://github.com/timtebeek) in [openrewrite/rewrite-migrate-java#1200](https://redirect.github.com/openrewrite/rewrite-migrate-java/pull/1200)
> * Upgrade `maven-pmd-plugin` as part of the Java 17 migration by [`@​timtebeek`](https://github.com/timtebeek) in [openrewrite/rewrite-migrate-java#1208](https://redirect.github.com/openrewrite/rewrite-migrate-java/pull/1208)
> * Update inline Guava recipes for Guava 33.7.0 by [`@​timtebeek`](https://github.com/timtebeek) in [openrewrite/rewrite-migrate-java#1207](https://redirect.github.com/openrewrite/rewrite-migrate-java/pull/1207)
> * Extend `UseListOf` prose pattern to `LinkedHashSet` by [`@​timtebeek`](https://github.com/timtebeek) in [openrewrite/rewrite-migrate-java#1209](https://redirect.github.com/openrewrite/rewrite-migrate-java/pull/1209)
>
> **Full Changelog**: <openrewrite/rewrite-migrate-java@v3.42.0...v3.42.1>


Commits

* [`c5ef164`](openrewrite/rewrite-migrate-java@c5ef164) Extend `UseListOf` prose pattern to `LinkedHashSet` ([#1181](https://redirect.github.com/openrewrite/rewrite-migrate-java/issues/1181)) ([#1209](https://redirect.github.com/openrewrite/rewrite-migrate-java/issues/1209))
* [`57c644c`](openrewrite/rewrite-migrate-java@57c644c) Update inline Guava recipes for Guava 33.7.0 ([#1207](https://redirect.github.com/openrewrite/rewrite-migrate-java/issues/1207))
* [`4a91085`](openrewrite/rewrite-migrate-java@4a91085) Upgrade `maven-pmd-plugin` as part of the Java 17 migration ([#1208](https://redirect.github.com/openrewrite/rewrite-migrate-java/issues/1208))
* [`1cb4f8d`](openrewrite/rewrite-migrate-java@1cb4f8d) [Auto] SDKMAN! Java candidates as of 2026-08-17T1025
* [`75f07f7`](openrewrite/rewrite-migrate-java@75f07f7) Do not duplicate JSpecify annotations when several annotations map to one ([#1](https://redirect.github.com/openrewrite/rewrite-migrate-java/issues/1)...
* See full diff in [compare view](openrewrite/rewrite-migrate-java@v3.42.0...v3.42.1)
  
[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility\_score?dependency-name=org.openrewrite.recipe:rewrite-migrate-java&package-manager=maven&previous-version=3.42.0&new-version=3.42.1)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)
Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`.
[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)
---
Dependabot commands and options
  
You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot show  ignore conditions` will show all of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

1 participant