One of the most useful code quality plugins for Jenkins is the Violations plugin. This plugin will not analyse your project source code (you need to configure your build to do that), but it does a great job on reporting on the code quality metrics generated for individual builds and trends over time. The plugin caters for reports on code quality metrics coming from a large range of static analysis tools, including:
Checkstyle, CPD, PMD, FindBugs, and jcreport
gendarme and stylecop
Installing the plugin is straightforward. Just go to the Plugin Manager screen and select the Jenkins Violations plugin. Once you have installed the plugin and restarted Jenkins, you will be able to use it for your projects.
The Violations plugin does not generate the code quality metrics
data itself—you need to configure your built to do that, as shown in the
previous section. An example of doing this for a Maven build job is
illustrated in Figure 9-3. Notice that
here we are invoking the Maven plugin goals directly. We could also just
mvn site, but if we are only interested in the code
quality metrics, and not the other elements of the Maven-generated site,
calling the plugins directly will result in faster builds.
Figure 9-3. Generating code quality reports in a Maven build
Once you have set ...