Details
-
Improvement
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
1.5.0
-
Important
Description
Properties section
<!-- See https://pmd.github.io/ for available latest version --> <pmd.version>5.1.6</pmd.version>
Build section
<plugin> <!-- to disable - mvn [commands...] -Dpmd.skip --> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-pmd-plugin</artifactId> <configuration> <rulesets> <ruleset>${workspace.root.dir}${file.separator}pmd-ruleset-sshd.xml</ruleset> </rulesets> <ncludeTests>true</includeTests> </configuration> <executions> <execution> <id>pmd-checker</id> <!-- Note: phase must be AFTER detection of workspace root dir --> <phase>verify</phase> <goals> <goal>check</goal> </goals> </execution> </executions> </plugin>
Plugins management
<plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-pmd-plugin</artifactId> <version>3.8</version> <configuration> <targetJdk>${javac.target}</targetJdk> <printFailingErrors>true</printFailingErrors> <skipPmdError>false</skipPmdError> <excludeRoots> <excludeRoot>target/generated-sources/java</excludeRoot> </excludeRoots> </configuration> <dependencies> <dependency> <groupId>net.sourceforge.pmd</groupId> <artifactId>pmd-core</artifactId> <version>${pmd.version}</version> </dependency> <dependency> <groupId>net.sourceforge.pmd</groupId> <artifactId>pmd-java</artifactId> <version>${pmd.version}</version> </dependency> </dependencies> </plugin>
Reporting section
<reporting> <plugins> <plugin> <!-- used by PMD to create a source XREF --> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-jxr-plugin</artifactId> <version>2.5</version> </plugin> </plugins> </reporting>
pmd-ruleset-sshd.xml
<?xml version="1.0"?> <ruleset name="MINA SSHD PMD ruleset" xmlns="http://pmd.sourceforge.net/ruleset/2.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://pmd.sourceforge.net/ruleset/2.0.0 http://pmd.sourceforge.net/ruleset_2_0_0.xsd"> <description> This ruleset defines the PMD rules for MINA SSHD project </description> <!-- See https://pmd.github.io/pmd-5.6.1/pmd-java/rules/index.html --> <rule ref="rulesets/java/basic.xml/BooleanInstantiation" /> <rule ref="rulesets/java/basic.xml/ExtendsObject" /> <rule ref="rulesets/java/braces.xml" /> <rule ref="rulesets/java/clone.xml/ProperCloneImplementation" /> <rule ref="rulesets/java/clone.xml/CloneMethodMustImplementCloneable" /> <rule ref="rulesets/java/javabeans.xml/MissingSerialVersionUID" /> <rule ref="rulesets/java/logging-java.xml/AvoidPrintStackTrace" /> </ruleset>