Skip to content

www.rolfje.com

Why Jenkins does not detect Failures

Posted on 2011-06-20 By rolfje 4 Comments on Why Jenkins does not detect Failures

Jenkins, the brilliant Continuous Integration build server, has a bit of a problem with the Maven surefire jUnit test plugin. Last sunday, I discovered that our Jenkins build server suddenly started ignoring test failures. While the logfile clearly states that the Unittests contain failures, Jenkins marks the builds as “stable”.

After some digging around, I found that even though Jenkins explicitly tells you in the logfile that it will fail the build, it will not do so if the Surefire XML reports are not generated. In our case, somebody in the team decided that the generation of the XML Surefire reports was taking too long and had disabled them in the Maven pom.xml.

In order to solve this, I re-enabled the XML reports and voila, Jenkins happily started reporting errors again. Here is the correct Surefire plugin configuration for you to use in your maven pom.xml file:

<plugin>
  <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-surefire-plugin</artifactId>
    <version>2.8</version>
    <configuration>

      <!-- Please note that Jenkins needs Surefire
           XML reports in order for detection to work.
           Keep this property set to false. -->
      <disableXmlReport>false</disableXmlReport>
    </configuration>
</plugin>
Software Tags:build server, CI, hudson, jenkins, programming

Post navigation

Previous Post: ^H(eaven) key binding in Eclipse
Next Post: Replacing Dropbox with Spideroak

Comments (4) on “Why Jenkins does not detect Failures”

  1. Sybren says:
    2011-07-03 at 20:30

    Disabling the disableXmlReport option… some programmers just love double negatives. What’s wrong with enableXmlReport=true?

    Reply
    1. rolfje says:
      2011-07-03 at 20:40

      One of my pet peeves as well. Personally, I think “generateXMLReport=true” is even better.

      Reply
  2. Christoffer Hammarström says:
    2012-02-03 at 17:19

    You’re thinking too small, even better would be <report>xml</report>, or enabled(true/1/on/yes)

    Reply
  3. Jonathan says:
    2012-11-16 at 19:40

    Thanks very much man! You made my day! I was having this problem but with Failsafe (a fork of Surefire) in Jenkins and I could make it work by adding a Post Build step to copy the reports from the acceptance-test module to the “root”/target directory. Thank you!!!

    Reply

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

           

Recent Comments

  • rolfje on Methode Buijs uitgelegd
  • LinkedIn is at Peak Enshittifaction – Will Chatham's Blog on Linked-In not really Opt-in?
  • Hans j on 1N4148 diode as RF switch
  • Roaming Rhonda on DLNA on OSX, done right
  • Frans on How to fix a Krups XN2001 Nespresso machine

Tags

Anonimatron Apple backup design DIY DRM eclipse environment Fun gmail google hacking hamradio Hardware helicopter iphone ipod iTunes Java Keynote maven modelling motorcycle music news opinion oracle osx photo photography programming repair review security Software Steve Jobs T-Mobile technology Time Machine Ubuntu usability Utilities vacation windows Workshop

Categories

  • Apple (105)
  • Divorce (1)
  • Electronics (3)
  • Fun (57)
  • Games (7)
  • Hardware (72)
  • Microsoft (18)
  • Racing (14)
  • Software (134)
  • Uncategorized (65)
  • Workshop (20)

Archives

Copyright © 2025 www.rolfje.com.

Powered by PressBook WordPress theme