jenkins the definitive guide

(Jeff_L) #1

Figure 9.21. Configuring Sonar in a build job


You typically set up Sonar to run on a regular basis, for example every night or once a week. So you
can activate Sonar on your normal unit/integration test build job, simply by adding a schedule (see
Figure 9.22, “Scheduling Sonar builds”). This avoids duplicated configuration details between jobs. Or,
if you already have a scheduled build job that runs with an appropriate frequency (such as a dedicated
code quality metrics build), you can activate Sonar on this build job.


Figure 9.22. Scheduling Sonar builds


If you click on the Advanced button, you can specify other more sophisticated options, such as running
your Sonar build on a separate branch, passing Maven additional command-line options (such as extra
memory), or overriding the default trigger configuration.


By default, Sonar will run even if the normal build fails. This is usually what you want, as Sonar should
record build and test failures as well as successful results. However, if required, you can deactivate this
option too in the Advanced options.

Free download pdf