Apache Maven 1.x has reached its end of life, and is no longer supported. For more information, see the announcement. Users are encouraged to migrate to the current version of Apache Maven.

PMD Plug-in Properties

Property Optional? Default Description
maven.pmd.enable No true Enable/disable the PMD plugin. Has to be set to "true" to enable the plugin
maven.pmd.rulesetfiles Yes rulesets/basic.xml, rulesets/unusedcode.xml, rulesets/imports.xml Defines the rule sets that PMD uses to scan the code checking for violations. Comma separated list. Can specify rulesets that ship with PMD (in the PMD jar, which are all in the "rulesets" package) and custom rulesets of PMD rules and/or your own rules. (suggestion is to specify custom rule jars as a project dependency so Maven automatically puts them on the classpath and PMD will automatically find them)
maven.pmd.includes Yes **/*.java, which matches all Java source files in the source tree (specified by the ${maven.src.dir} property. Specifies a comma-separated list of Ant patterns to use when matching files in the source tree to be included in the PMD report. The pattern specified is relative to ${maven.src.dir}.
maven.pmd.excludes Yes (no files excluded) Specifies a comma-separated list of Ant patterns to use when matching files in the source tree to be excluded from the PMD report. The pattern specified is relative to ${maven.src.dir}.
maven.pmd.cpd.enable Yes false Enable/disable the CPD report.
maven.pmd.cpd.minimumtokencount Yes 100 Specifies the minimum number of tokens required to consider two sequences of tokens identical.
maven.pmd.check.tests Yes true Whether or not to run PMD on test sources.
maven.pmd.console Yes false Whether or not to display PMD errors to the console.
maven.pmd.failonerror Yes false Whether or not to fail the build if any errors occur while processing the files.
maven.pmd.failonruleviolation Yes false Whether or not to fail the build if PMD finds any rule violations.
maven.pmd.targetjdk Yes ${maven.compile.source} The target JDK: 1.3, 1.4, or 1.5...
maven.pmd.stylesheet Yes ${plugin.resources}/pmd.jsl A custom stylesheet to use for the report. An alternative stylesheet is supplied that includes priority information of pmd violations. To use it, set maven.pmd.stylesheet=${plugin.resources}/pmd-priority.jsl.