PMD

By default, plugin is activated if java sources available (src/main/java).

Default config contains all java checks, but some of them are disabled. Remove exclusion to enable disabled rule.

Warning

Pmd 6.0 changed rule groups. Default confing was rewritten accordingly.

Output

23 PMD rule violations were found in 2 files

[Comments | CommentRequired] sample.(Sample.java:3) 
  headerCommentRequirement Required
  https://pmd.github.io/pmd-5.4.0/pmd-java/rules/java/comments.html#CommentRequired

...

Note

Pmd will always show warning in logs:

This analysis could be faster, please consider using Incremental Analysis: https://pmd.github.io/pmd-6.1.0/pmd_userdocs_getting_started.html#incremental-analysis
This is known gradle issue, without solution.

Config

Tool config options with defaults:

quality {
    pmdVersion = '6.1.0'
    pmd = true // false to disable automatic plugin activation
}

Suppress

To suppress violation:

@SuppressWarnings("PMD.CommentRequired")

To suppress all violations:

@SuppressWarnings("PMD")