Details
Description
maven-pmd-plugin should be toolchains-aware and pick up the correct JDK used for compilation. If toolchains is in use, it should select that one, not use the same JDK that maven is running.
We have an enterprise build system which runs maven under JDK 1.8. Some projects target 1.8, others target 11. The switch is handled using toolchains.xml.
PMD seemingly cannot cope with 11 code when maven is running under 1.8. We are forced to set `pmd.typeResolution=false` to avoid all sorts of strange errors (eg. 'unused private method' despite it being used 28 times in the same class).
We do have `targetJdk=11`.
These false errors do not occur when maven itself runs under JDK 11, with `pmd.typeResolution=true`.
Attachments
Issue Links
- relates to
-
MPMD-320 Error when using toolchain and spaces in repository path
- Closed
- links to