Table of Contents
API Documentation: | PmdExtension |
---|
Configuration options for the PMD plugin.
Property | Description |
consoleOutput | Whether or not to write PMD results to |
ignoreFailures | Whether to allow the build to continue if there are warnings. Example: ignoreFailures = true |
reportsDir | The directory where reports will be generated. |
rulePriority | The rule priority threshold; violations for rules with a lower priority will not be reported. Default value is 5, which means that all violations will be reported. This is equivalent to PMD's Ant task minimumPriority property. See the official documentation for the list of priorities. |
ruleSetConfig | The custom rule set to be used (if any). Replaces |
ruleSetFiles | The custom rule set files to be used. See the official documentation for how to author a rule set file.
If you want to only use custom rule sets, you must clear |
ruleSets | The built-in rule sets to be used. See the official list of built-in rule sets. |
sourceSets | The source sets to be analyzed as part of the |
targetJdk | The target jdk to use with pmd, 1.3, 1.4, 1.5, 1.6, 1.7 or jsp |
toolVersion | The version of the code quality tool to be used. |
Method | Description |
ruleSetFiles(ruleSetFiles) | Convenience method for adding rule set files. |
ruleSets(ruleSets) | Convenience method for adding rule sets. |
Whether to allow the build to continue if there are warnings. Example: ignoreFailures = true
File
reportsDir
The directory where reports will be generated.
The rule priority threshold; violations for rules with a lower priority will not be reported. Default value is 5, which means that all violations will be reported. This is equivalent to PMD's Ant task minimumPriority property. See the official documentation for the list of priorities.
rulePriority = 3
- Default:
5
TextResource
ruleSetConfig
The custom rule set to be used (if any). Replaces ruleSetFiles
, except that it does not currently support multiple rule sets.
See the official documentation for how to author a rule set.
ruleSetConfig = resources.text.fromFile("config/pmd/myRuleSet.xml")
- Default:
null
FileCollection
ruleSetFiles
The custom rule set files to be used. See the official documentation for how to author a rule set file.
If you want to only use custom rule sets, you must clear ruleSets
.
ruleSetFiles = files("config/pmd/myRuleSet.xml")
- Default:
[]
The built-in rule sets to be used. See the official list of built-in rule sets.
ruleSets = ["category/java/errorprone.xml", "category/java/bestpractices.xml"]
- Default:
["category/java/errorprone.xml"]
Collection
<SourceSet
>
sourceSets
Collection
<SourceSet
>The source sets to be analyzed as part of the check
and build
tasks.
- Default:
project.sourceSets
TargetJdk
targetJdk
The target jdk to use with pmd, 1.3, 1.4, 1.5, 1.6, 1.7 or jsp
- Default:
project.sourceCompatibility
String
toolVersion
The version of the code quality tool to be used.