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

Enable typeResolution by default

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 3.8
    • PMD
    • None

    Description

      For some time now PMD has supported type resolution, allowing PMD rules to make better decisions by having knowledge of all classes in both the project, and the classpath.

      However, when using PMD through the Maven plugin, the auxclasspath for type resolution is not populated by default. There is a property to control this behavior, but it's set to false by default. See https://maven.apache.org/plugins/maven-pmd-plugin/pmd-mojo.html#typeResolution

      I believe there is no reason to have it off by default (actually, I don't think there is any valid reason to have it off at all!). Type resolution means better and more accurate analysis results. If there are no rules configured requiring type resolution, the type resolution analysis is skipped completely, meaning there is no performance impact either.

      I've not checked, but just in case the classpath passed to PMD should include:

      • all dependencies
      • the .class files generated by compiling the project's source code

      Attachments

        Issue Links

          Activity

            People

              adangel Andreas Dangel
              jmsotuyo Juan Martín Sotuyo Dodero
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: