Skip to content

chore: Enforce bytecode version JDK 8 - #6973

Merged
UncleOwen merged 6 commits into
pmd:mainfrom
adangel:chore/enforce-bytecode-version-8
Aug 15, 2026
Merged

UncleOwen merged 6 commits into
pmd:mainfrom
adangel:chore/enforce-bytecode-version-8

Conversation

@adangel

@adangel adangel commented Aug 13, 2026 •

Copy link
Copy Markdown
Member

Describe the PR

I found this while testing/updating maven-pmd-plugin with the current PMD snapshot version.

We have a couple of dependencies, that are not compatible with Java 8 anymore - so, if someone would run PMD in a true Java 8 environment, that could fail.

I've therefore downgraded the dependency org.checkerframework:checker-qual from 4.2.2 (which requires Java 11) to 3.55.1 - last version compatible with Java 8.

There are two language modules, that already use newer dependencies:

  • pmd-groovy: It uses org.apache.groovy:groovy 5.x, which requires Java 11. That means, that for finding duplicates in groovy, you'll need to use Java 11 or later.
  • pmd-kotlin: It uses nl.stokpop.typemapper:kotlin-type-mapper-analyzer which requires Java 17. That means, whoever uses Kotlin, can't use Java 8 (which probably is ok).

This PR adds the enforcer-plugin rule "enforceBytecodeVersion" to avoid introducing further incompatible dependencies. These should wait until PMD 8 (the next major release).

With the downgrade of checker-qual, maven-pmd-plugin can actually upgrade the default PMD version again.

Related issues

Ready?

  • Added unit tests for fixed bug/feature
  • Passing all unit tests
  • Complete build ./mvnw clean verify passes (checked automatically by github actions)
  • Added (in-code) documentation (if needed)

@adangel adangel added this to the 7.27.0 milestone Aug 13, 2026
@pmd-actions-helper

Copy link
Copy Markdown
Contributor

Documentation Preview

No relevant source code has been changed, pmdtester skipped.

(comment created at 2026-08-13 15:07:40+00:00 for 28cb112)

@UncleOwen UncleOwen left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops. Nice catch!

@UncleOwen
UncleOwen merged commit 98052d8 into pmd:main Aug 15, 2026
12 checks passed
@adangel
adangel deleted the chore/enforce-bytecode-version-8 branch August 15, 2026 09:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants