O'Reilly logo

Jenkins Continuous Integration Cookbook by Alan Berg

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Creating custom PMD rules

PMD has two extra features when compared to other static code review tools. The first is the cpdgui tool, which allows you to look for the code that has been cut-and-pasted from part of the code base to another. The second, and the one that we will explore in this recipe, is the ability to design custom bug discovery rules for Java source code using Xpath.

Getting ready

Make sure that you have installed the Jenkins PMD plugin (https://wiki.jenkins-ci.org/display/JENKINS/PMD+Plugin). Download and unpack the PMD distribution from http://pmd.sourceforge.net. Visit the PMD bin directory, and verify that you have the startup scripts designer.sh and designer.bat.

How to do it...

  1. Create a Maven project from the command line using: ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required