Skip to content

PMD plugin

Anton Antonenko edited this page Sep 22, 2016 · 1 revision

Enabling

To enable PMD for module add following code to pom.xml in section <plugins></plugins>:

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-pmd-plugin</artifactId>
</plugin>

If you need report being generated without failing a build add:

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-pmd-plugin</artifactId>
    <configuration>
        <failOnViolation>false</failOnViolation>
    </configuration>
</plugin>

Report

PMD generates a report which can be found in the ./your_module_name/target/pmd directory.

Rulesets

Rulesets for PMD stored in /pmd-rulesets.xml