Pmd: Better out of the box experience

Gradle’s pmd plugin is okay, but it behaves in surprising ways out of the box compared to better plugins like Checkstyle and FindBugs.

  1. Gradle PMD strangely has console output disabled by default, forcing users to manually open report files, where most other linters simply show the warnings in the console. In the future, could consoleOutput please default to true?
  2. Gradle PMD makes it really hard to figure out how to exclude classes from being linted (for example, Java code generated from the Thrift plugin). The ordinary PMDExtension documentation doesn’t mention how to do this.

As it happens, the Pmd docs cover this feature, as a configurable excludes property in the pmdMain task.

Could we please expose these properties to the top-level pmd configuration block? That’s the first place I would have looked to configure PMD, as I would for other linter plugins.