5.7 Adding PMD Report

compared with
Key
These lines were removed. This word was removed.
These lines were added. This word was added.

View page history


There are 9 changes. View first change.

 To add [PMD|http://pmd.sourceforge.net] report, only need two steps:
 # Generate PMD *XML* report from [Ant|http://ant.apache.org] or [Maven|http://maven.apache.org] or any other build tools.
  To add [PMD|http://pmd.sourceforge.net] report, you only need two steps:
 # Generate PMD *XML* report from [Ant|http://ant.apache.org] or [Maven|http://maven.apache.org] or any other build tool.
 # Publish PMD report in the [configuration|1. Working with Configuration].
  
 h2. Generate PMD Report
QuickBuild will NOT generate [PMD|http://pmd.sourceforge.net] report automatically, so first make sure the PMD report is produced by [ANT|http://ant.apache.org] or by any other build tools, the following example shows how to generate PMD XML report by [PMD Ant task|http://pmd.sourceforge.net/ant-task.html]:
  
QuickBuild will NOT generate [PMD|http://pmd.sourceforge.net] report automatically, so first make sure the PMD report is produced by [ANT|http://ant.apache.org] or by any other build tool. The following example shows how to generate PMD XML report by using [PMD Ant task|http://pmd.sourceforge.net/ant-task.html]:
 {code:xml|title= CheckStyle target in build.xml}
 <taskdef name="pmd" classname="net.sourceforge.pmd.ant.PMDTask"/>
  
 <target name="pmd">
  <taskdef name="pmd" classname="net.sourceforge.pmd.ant.PMDTask"/>
  <pmd rulesetfiles="imports.xml,unusedcode">
  <formatter type="xml" toFile="c:\pmd_report.xml"/>
  <fileset dir="C:\j2sdk1.4.1_01\src\java\lang\">
  <include name="**/*.java"/>
  </fileset>
  </pmd>
 </target>
 {code}
After adding the target, you can generate the XML report for your source code, and after that you can tell QuickBuild to publish the results.
  
After adding generate the XML report for your source code, you can tell QuickBuild to add those results now.
  
 h2. Publish PMD Report
Just like all other [build reports|5. Publish Build Reports], to add PMD report is by [adding a publish step|Working With Step] in a [configuration|1. Working with Configuration]. When you add publish PMD Report step, the following screen will be displayed:
  
!pmd_step.png!
  Just like all other [build reports|5. Publish Build Reports], you add PMD report by [adding a publish step|Working With Step] in a [configuration|1. Working with Configuration]. When you add publish PMD Report step, the following screen will be displayed:
  
In source report files field, QuickBuild use an [enhanced Ant style file patterns|File Pattern Reference] to collect the reports, and the directory you specified is *relative* to the [workspace|Glossary#Workspace] directory.
  !pmd_step.png|width=32,height=32!
  
 Now, QuickBuild will analyze the PMD report and will generate the Overview/Details after each build, and also will generate the statistics data for them.
  In source report files field, QuickBuild uses an [enhanced Ant style file patterns|File Pattern Reference] to collect the reports, and the directory you specified is *relative* to the [workspace|Glossary#Workspace] directory.
  
 QuickBuild will analyze the PMD report and it will generate the Overview/Details after each build, and it also will generate the statistics data for the reports.