Uploaded image for project: 'Maven PMD Plugin'
  1. Maven PMD Plugin
  2. MPMD-304

maven-pmd-plugin should be toolchains-aware

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 3.13.0
    • 3.14.0
    • CPD, PMD
    • None
    • maven 3.6.3
      JDK 1.8 (maven)
      JDK 11 (toolchains.xml)

    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

          Activity

            People

              adangel Andreas Dangel
              edrandall Ed Randall
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: