Disconnect between Gradle plugin docs and actual confirguration suntax

Many Gradle plugins, including builtins like checkstyle, pmd, and jacoco, appear to offer easy, top-level configuration options such as exclusion filters. However, the way the plugins are written, actually requires a much more involved configuration block, under a different name (e.g. pmd vs pmdMain), and none of this is documented in the plugin docs. It’s basically a pain to configure many of these plugins, in a build tool that claims to promote convention over configuration.


This is typically the case for plugins that create multiple tasks, and those tasks share configuration. That shared configuration is typically placed under a project extension (ex. pmd { }) whereas configuration particular to any given task is done on the task itself. Admittedly, this isn’t always implemented consistently, with the tasks typically exposing much more options than the extension.

As for the lack of documentation, I’m not sure I understand. If you look at the docs for the pmd plugin you’ll clearly see the pmdMain task listed as well as a link to the DSL reference documenting all the available options on the task.