------ Maven 2 PMD Plugin: configuration examples ------ ------ January 6, 2006 Introduction The {{{http://pmd.sourceforge.net/}PMD}} plugin allows you to automatically run the PMD code analysis tool on your project's source code and generate a site report with its results. * pmd:pmd - run PMD and generate the report * pmd:cpd - run PMD's Copy/Paste Detector tool and generate a report Configuration The PMD and CPD reports share the same configuration. For example, the following tells Maven to run the PMD and CPD report as part of the site report generation, use the 'basic' and 'controversial' PMD rulesets and output the report in XML format. The rulesets may reside in the classpath, filesystem or at a URL. Note that HTML is always generated in addition to any other alternate format. Legal formats are "html", "csv", "xml" and "txt". The reports will link directly to the cross-referenced source if you enable this with the linkXref parameter. See the {{{http://mojo.codehaus.org/jxr-maven-plugin/}JXR}} plugin for more details. If your source uses a non-default encoding, you can use the sourceEncoding parameter to tell Maven which encoding to use when reading the java source. You can configure the minimum code size which trips the CPD. The default of 100 tokens cooresponds to approxiamately 5-10 lines of code. +-------- org.apache.maven.plugins maven-pmd-plugin /rulesets/basic.xml /rulesets/controversial.xml d:\rulesets\strings.xml http://localhost/design.xml xml true utf-8 100 +---------