17.08.2016 Views

Apache Maven 3 Cookbook

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Software Engineering Techniques<br />

2.5<br />

<br />

<br />

/rulesets/basic.xml<br />

/rulesets/controversial.xml<br />

http://localhost/design.xml<br />

<br />

utf-8<br />

100<br />

1.6<br />

<br />

<br />

To execute these PMD checks, start the command line, navigate to the project POM folder, and<br />

execute the pmd goal in the pmd plugin, as shown as follows:<br />

mvn pmd:pmd<br />

The PMD checks can be integrated with <strong>Maven</strong>'s default build lifecycle, as shown in the<br />

following code:<br />

<br />

<br />

<br />

org.apache.maven.plugins<br />

maven-pmd-plugin<br />

2.5<br />

<br />

<br />

<br />

check<br />

cpd-check<br />

<br />

<br />

<br />

<br />

<br />

<br />

How it works...<br />

PMD is an open source tool that scans Java code and generates code quality reports. The<br />

reports are generated based on identification of potential bugs, dead code, non-optimized<br />

code, duplicate code, and so on.<br />

36

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!