------ Usage ------ Maria Odea Ching ------ 23 June 2006 ------ ~~ Copyright 2006 The Apache Software Foundation. ~~ ~~ Licensed under the Apache License, Version 2.0 (the "License"); ~~ you may not use this file except in compliance with the License. ~~ You may obtain a copy of the License at ~~ ~~ http://www.apache.org/licenses/LICENSE-2.0 ~~ ~~ Unless required by applicable law or agreed to in writing, software ~~ distributed under the License is distributed on an "AS IS" BASIS, ~~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ~~ See the License for the specific language governing permissions and ~~ limitations under the License. ~~ NOTE: For help with the syntax of this file, see: ~~ http://maven.apache.org/guides/mini/guide-apt-format.html Usage The PMD plugin generates PMD and CPD reports using the PMD code analysis tool. To include a report with default rule sets and configuration in your project site, set the following in the <<<\>>> section of your pom: +-----+ ... org.apache.maven.plugins maven-pmd-plugin ... +-----+ You can also explicitly execute the PMD plugin and generate the same report by setting the plugin in the <<<\>>> section of your pom as shown below: +-----+ ... org.apache.maven.plugins maven-pmd-plugin ... +-----+ 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. The reports will link directly to the cross-referenced source if you enable this with the <<>> parameter. See the {{{http://maven.apache.org/plugins/maven-jxr-plugin/}JXR plugin}} for more details. If your source uses a non-default encoding, you can use the <<>> parameter to tell Maven which encoding to use when reading the java source. Note also the ability to exclude source which you want to ignore. You can configure the minimum code size which trips the CPD. The default of 100 tokens corresponds to approxiamately 5-10 lines of code. Since PMD parses the Java source, it needs to know which Java version to use. The default is 1.4. The following is a possible configuration: +-----+ ... org.apache.maven.plugins maven-pmd-plugin true utf-8 100 1.5 **/*Bean.java **/generated/*.java ... +-----+