org.gradle.api.plugins.quality

## Class PmdExtension

- java.lang.Object
- - groovy.lang.GroovyObjectSupport
  - - org.gradle.api.plugins.quality.CodeQualityExtension
    - - org.gradle.api.plugins.quality.PmdExtension

- All Implemented Interfaces:
    GroovyObject

      public class PmdExtension
      extends CodeQualityExtension

  Configuration options for the PMD plugin.
  See Also:
    `PmdPlugin`

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `PmdExtension(Project project)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `getConsoleOutput()` Whether or not to write PMD results to `System.out`.
    `int` | `getRulePriority()` The rule priority threshold; violations for rules with a lower priority will not be reported.
    `TextResource` | `getRuleSetConfig()` The custom rule set to be used (if any).
    `FileCollection` | `getRuleSetFiles()` The custom rule set files to be used.
    `List<String>` | `getRuleSets()` The built-in rule sets to be used.
    `TargetJdk` | `getTargetJdk()` The target jdk to use with pmd, 1.3, 1.4, 1.5, 1.6, 1.7 or jsp
    `boolean` | `isConsoleOutput()`
    `void` | `ruleSetFiles(Object... ruleSetFiles)` Convenience method for adding rule set files.
    `void` | `ruleSets(String... ruleSets)` Convenience method for adding rule sets.
    `void` | `setConsoleOutput(boolean consoleOutput)`
    `void` | `setRulePriority(int intValue)` Sets the rule priority threshold.
    `void` | `setRuleSetConfig(TextResource ruleSetConfig)`
    `void` | `setRuleSetFiles(FileCollection ruleSetFiles)`
    `void` | `setRuleSets(List<String> ruleSets)`
    `void` | `setTargetJdk(Object value)` Sets the target jdk used with pmd.

    - ### Methods inherited from class org.gradle.api.plugins.quality.CodeQualityExtension

      `getIgnoreFailures, getReportsDir, getSourceSets, getToolVersion, isIgnoreFailures, setIgnoreFailures, setReportsDir, setSourceSets, setToolVersion`

    - ### Methods inherited from class groovy.lang.GroovyObjectSupport

      `getMetaClass, getProperty, invokeMethod, setMetaClass, setProperty`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### PmdExtension

          public PmdExtension(Project project)

  - ### Method Detail

    - #### getRuleSets

          public List<String> getRuleSets()

      The built-in rule sets to be used. See the official list of built-in rule sets. Example: ruleSets = ["basic", "braces"]

    - #### setRuleSets

          public void setRuleSets(List<String> ruleSets)

    - #### ruleSets

          public void ruleSets(String... ruleSets)

      Convenience method for adding rule sets. Example: ruleSets "basic", "braces"
      Parameters:
        `ruleSets` - the rule sets to be added

    - #### getTargetJdk

          public TargetJdk getTargetJdk()

      The target jdk to use with pmd, 1.3, 1.4, 1.5, 1.6, 1.7 or jsp

    - #### setTargetJdk

          public void setTargetJdk(Object value)

      Sets the target jdk used with pmd.

    - #### getRulePriority

          @Incubating
          public int getRulePriority()

      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. Example: rulePriority = 3

    - #### setRulePriority

          @Incubating
          public void setRulePriority(int intValue)

      Sets the rule priority threshold.

    - #### getRuleSetConfig

          @Incubating
          public TextResource getRuleSetConfig()

      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. Example: ruleSetConfig = resources.text.fromFile("config/pmd/myRuleSet.xml")
      Since:
        2.2

    - #### setRuleSetConfig

          @Incubating
          public void setRuleSetConfig(TextResource ruleSetConfig)

    - #### getRuleSetFiles

          public FileCollection getRuleSetFiles()

      The custom rule set files to be used. See the official documentation for how to author a rule set file. Example: ruleSetFiles = files("config/pmd/myRuleSet.xml")

    - #### setRuleSetFiles

          public void setRuleSetFiles(FileCollection ruleSetFiles)

    - #### ruleSetFiles

          public void ruleSetFiles(Object... ruleSetFiles)

      Convenience method for adding rule set files. Example: ruleSetFiles "config/pmd/myRuleSet.xml"
      Parameters:
        `ruleSetFiles` - the rule set files to be added

    - #### isConsoleOutput

          @Incubating
          public boolean isConsoleOutput()

    - #### getConsoleOutput

          @Incubating
          public boolean getConsoleOutput()

      Whether or not to write PMD results to `System.out`.

    - #### setConsoleOutput

          @Incubating
          public void setConsoleOutput(boolean consoleOutput)