slachiewicz opened a new pull request, #788:
URL: https://github.com/apache/maven-pmd-plugin/pull/788

   `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 second 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).
   
   ---
   
   - [x] I hereby declare this contribution to be licensed under the [Apache 
License Version 2.0, January 2004](https://www.apache.org/licenses/LICENSE-2.0)
   - [x] I hereby declare that I have filed an [Apache Individual Contributor 
License Agreement](https://www.apache.org/licenses/icla.pdf).
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to