jenkins the definitive guide

(Jeff_L) #1

Figure 5.36. Email notification


You can also opt to send a separate email to the user who’s commit (presumably) broke the build. For this
to work, you need to have activated Security on your Jenkins server (see Chapter 7, Securing Jenkins).


Normally, Jenkins will send an email notification out whenever a build fails (for example, because of
a compilation error). It will also send out a notification when the build becomes unstable for the first
time (for example, if there are unit test failures). Unless you configure it to do so, Jenkins will not send
emails for every unstable build, but only for the first one.


Finally, Jenkins will send a message when a previously failing or unstable build succeeds, to let everyone
know that the problem has been resolved.


5.7.4. Building Other Projects


You can also start other build jobs in the Post-build Actions, using the “Build other projects” option.
This is useful if you want to organize your build process in several, smaller steps, rather than one long
build job. Just list the projects you want to start after this one. Normally, these projects will only be
triggered if the build was stable, but you can optionally trigger another build job even if the current build
is unstable. This might be useful, for example, if you wanted to run a code quality metrics reporting
build job after a project’s main build job, even if there are test failures in the main build.


5.8. Running Your New Build Job


Now all you need to do is save your new build job. You can then trigger the first build manually, or
just wait for it to kick off by itself. Once the build is finished, you can click on the build number to
see the results of your work.


5.9. Working with Maven Build Jobs


In this section, we will have a look at the other most commonly used build job: Maven 2/3 build jobs.


Maven build jobs are specifically adapted to Maven 2 and Maven 3 builds. Creating a Maven build
job requires considerably less work than configuring the equivalent freestyle build job. Maven build
jobs support advanced Maven-related features such as incremental builds on multimodule projects and
triggering builds from changes in snapshot dependencies, and make configuration and reporting much
simpler.

Free download pdf