GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Default targetJdk to maven.compiler.release, then maven.compiler.source by slachiewicz · Pull Request #788 · apache/maven-pmd-plugin

Conversation

@slachiewicz

@slachiewicz slachiewicz commented Nov 18, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

targetJdk defaulted to ${maven.compiler.source} only. A project that sets just maven.compiler.release, the usual setup since JDK 9, got no targetJdk: PMD parsed the code as the latest Java version and the plugin looked up no JDK toolchain for platform classes. targetJdk now falls back to maven.compiler.release, then to maven.compiler.source; an explicit targetJdk still wins. Release takes precedence over source, as in the Maven Compiler Plugin, so a project that sets both now analyses with its release value.

The Target JDK page now describes the new default instead of the <targetJdk>${maven.compiler.release}</targetJdk> workaround, and a separate commit fixes a typo in the warning for a toolchain without a java executable ("Could't").

Verified: with only maven.compiler.release set, 3.28.0 analyses as the latest Java and ignores the release; this branch looks up a JDK 17 toolchain for release 17 and, for release 8, rejects a Java 16 type pattern with "a feature of Java 16, you should select your language version accordingly". mvn -P run-its verify → unit tests and 26 ITs pass (4 skipped).


  • I hereby declare this contribution to be licensed under the Apache License Version 2.0, January 2004
  • I hereby declare that I have filed an Apache Individual Contributor License Agreement.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

adangel reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
@slachiewicz slachiewicz added the enhancement New feature or request label Nov 18, 2026
@slachiewicz slachiewicz mentioned this pull request Nov 18, 2026
Planned releases — Q4 2026 (Doxia stack + plugins + shared deps) apache/maven#13085
Open
slachiewicz added 3 commits November 18, 2026 07:27
@slachiewicz
Default targetJdk to maven.compiler.release, then maven.compiler.source
1e0590c
Projects that set only maven.compiler.release got no targetJdk: PMD parsed the code as the latest Java version and no JDK toolchain was looked up. An explicit targetJdk still wins; release takes precedence over source, as in the Maven Compiler Plugin.
@slachiewicz
Fix the typo in the missing java executable warning
fe0e5cf
@slachiewicz
Document the new targetJdk default
3ff68a6
@slachiewicz
slachiewicz force-pushed the target-jdk-from-release branch from 0466e32 to 3ff68a6 Compare November 18, 2026 07:27
@slachiewicz
slachiewicz marked this pull request as ready for review November 18, 2026 07:50
@adangel
adangel self-requested a review November 19, 2026 09:35
@adangel adangel added this to the 3.29.0 milestone Nov 19, 2026
adangel
adangel approved these changes Nov 19, 2026
View reviewed changes
Comment thread src/main/java/org/apache/maven/plugins/pmd/PmdReport.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread src/main/java/org/apache/maven/plugins/pmd/PmdReport.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

@adangel
Make method getTargetJdk() private
02abd15
@adangel
adangel merged commit 102a8af into apache:master Nov 19, 2026
14 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@adangel adangel self-assigned this Nov 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@adangel adangel adangel approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

@adangel adangel

Labels

enhancement New feature or request

Projects

None yet

Milestone

3.29.0

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@slachiewicz @adangel
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.