View Source

To publish [CPD|http://pmd.sourceforge.net/cpd.html] report, you only need two steps:
# Generate CPD *XML* report from [Ant|http://ant.apache.org] or [Maven|http://maven.apache.org] or any other build tool.
# Add CPD report publish step by choosing _Publish -> CPD Report_ from step menu.

h2. Generate CPD Report

QuickBuild will NOT generate [CPD|http://pmd.sourceforge.net/cpd.html] report automatically, so first make sure the CPD report is produced by [ANT|http://ant.apache.org] or by any other build tool. The following example shows how to generate CPD XML report with [CPD Ant task|http://pmd.sourceforge.net/cpd.html]:
{code:xml|title= CheckStyle target in build.xml}
<target name="cpd" depends="init" description="Generate the CPD XML report">
<taskdef name="cpd"
classname="net.sourceforge.pmd.cpd.CPDTask"
>
<classpath>
<fileset dir="${pmd.home}/lib">
<include name="*.jar"/>
</fileset>
</classpath>
</taskdef>
<mkdir dir="${cpd.report.dir}"/>
<cpd minimumTokenCount="100" format="xml" outputFile="${cpd.report.dir}/cpd_report.xml">
<fileset dir="${dir.src}">
<include name="**/*.java"/>
</fileset>
</cpd>
</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.

h2. Publish CPD Report
Add _*Publish CPD Report*_ step to your build workflow. If you have several report sets, you can add several steps with different report set names. Reference [this page|Publish Build Reports] for more details.