jenkins the definitive guide

(Jeff_L) #1

Once you have set this up, you can configure the violations plugin to generate reports and, if required,
trigger notifications, based on the report results. Just go to the Post-build Actions and check the Report
Violations checkbox. The details of the configuration vary depending on the project type. Lets look at
Freestyle build jobs first.


9.4.1. Working with Freestyle Build Jobs


Freestyle build jobs allow you the most configuration flexibility, and are your only option for non-Java
projects.


When you use the Violations plugin with a Freestyle build job, you need to specify the paths to each of
the XML reports generated by the static analysis tools you have used (see Figure 9.4, “Configuring the
violations plugin for a Freestyle project”). The plugin can cater for several reports from the same tool,
which is useful for Maven multimodule projects—just use a wildcard expression to identify the reports
you want (for example, **/target/checkstyle.xml).


Figure 9.4. Configuring the violations plugin for a Freestyle project


The Violations plugin will generate a graph tracking the number of each type of issue over time
(see Figure 9.5, “Violations over time”). The graph displays a different-colored line for each type of
violations your are tracking, as well as a summary of the latest results.

Free download pdf