1. Build Jenkins
Reference: Http://blog.csdn.net/xiaofei125145/article/details/51144827?locationNum=1 2, install DRY plugin
DRY Plug-in
3. Download PMD
https://sourceforge.net/projects/pmd/files/pmd/
4, decompression PMD and placed in the designated directory
I placed it in the ~/pmd/directory 5, new and configured Jenkins project 1 free-style software project 2 Configure SVN or git warehouse address 3 Add build step
Execute Shell
Export heapsize=4096m
~/pmd/pmd-bin-5.5.1/bin/run.sh CPD--minimum-tokens --format XML--language Objectivec--encoding UTF-8--files Pods--skip-duplicate-files > Cpd.xml | | Exit 0
Please do not directly copy the shell code, do not understand the shell code students see
PMD/CPD Use Help document links
Https://pmd.github.io/pmd-5.5.1/usage/cpd-usage.html
4 Add the build operation and configure the Duplicate code results directory, note the reference to build the shell of my configuration please look at the picture
> Cpd.xml
Select Publish Duplicate Code Analysis results (if the Jenkins Dry plugin is not installed, the health does not have this option)
after the configuration, as shown in figure:
PMD/CPD Use Help document links
Https://pmd.github.io/pmd-5.5.1/usage/cpd-usage.html