[ 
https://issues.apache.org/jira/browse/MPMD-304?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Ed Randall updated MPMD-304:
----------------------------
    Description: 
 maven-pmd-plugin should be 
[toolchains-aware|https://maven.apache.org/guides/mini/guide-using-toolchains.html]
 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.  
 PMD seemingly cannot cope with 11 code when it's running under 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`.

  was:
 maven-pmd-plugin should be 
[toolchains-aware|https://maven.apache.org/guides/mini/guide-using-toolchains.html]
 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.  
 PMD seemingly cannot cope with 11 code when it's running under 8. We are 
forced to set `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`.


> maven-pmd-plugin should be toolchains-aware
> -------------------------------------------
>
>                 Key: MPMD-304
>                 URL: https://issues.apache.org/jira/browse/MPMD-304
>             Project: Maven PMD Plugin
>          Issue Type: Bug
>    Affects Versions: 3.13.0
>         Environment: maven 3.6.3
> JDK 1.8 (maven)
> JDK 11 (toolchains.xml)
>            Reporter: Ed Randall
>            Priority: Major
>
>  maven-pmd-plugin should be 
> [toolchains-aware|https://maven.apache.org/guides/mini/guide-using-toolchains.html]
>  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.  
>  PMD seemingly cannot cope with 11 code when it's running under 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`.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to