jenkins the definitive guide

(Jeff_L) #1

The Violations plugin works well with multimodule Maven projects, but at the time of writing it needs a
little tweaking to obtain best results. Maven build jobs understand the structure of multimodule projects
(see Figure 9.9, “Jenkins Maven build jobs understand Maven multimodule structures”); furthermore,
you can drill down into any module and get a detailed view of the build results for that build job.


Figure 9.9. Jenkins Maven build jobs understand Maven multimodule structures


This is a very useful feature, but it means you need to do a little extra work to get all of the benefits out
of the Violations plugins for the individual modules. By default, the violations plugin will display an
aggregated view of the code quality metrics like the one in Figure 9.5, “Violations over time”. You can
also click on the violations graph, and view the detailed reports for each module.


However, for this to work correctly, you need to activate the violations plugin individually for each
module in addition to the main project. To do this, click on the module you want to configure in the
Modules screen, and then click on the “Configure” menu. Here, you will see a small subset of the usual
configuration options (see Figure 9.10, “Activating the Violations plugin for an individual module”).
Here, you just need to activate the Violations option, and configure the thresholds if required. On the
positive side, this means that you can define different threshold values for different modules.

Free download pdf