Thomas Sundberg

January 21, 2011

Failing Maven builds in Hudson

This post has been migrated to

Maven has a default behaviour that it fails a build if a test fails. Hudson and Jenkins turns this default behaviour up side down. Maven builds that fails are marked as unstable instead of failed. This behaviour may be surprising to anybody setting up a Maven build.

The solution is to set MAVEN_OPTS to -Dmaven.test.failure.ignore=false using the Advanced Build options on the project configuration page for a Maven job.

So set MAVEN_OPTS to


and your builds will fail instead of being marked as unstable.


  • Maven – A build system for building Java code
  • Hudson – A Continuous Integration server
  • Jenkins – Another Continuous Integration server
  • Thomas Sundberg – The author


  1. Thanks a lot for this short article🙂

    Comment by Aymen — October 19, 2011 @ 13:38

  2. But doesn’t this then stop running the tests on the first failure? In continuum, it would run all of the tests and fail the build if any tests failed.

    Comment by Big-G — January 10, 2012 @ 18:16

    • No, this doesn’t stop the execution of all test. They will be executed and reported as failed or successful and the build will be reported as unstable if you don’t set the MAVEN_OPTS to -Dmaven.test.failure.ignore=false

      I don’t really understand why Jenkins is build like that, but it is.

      Comment by Thomas Sundberg — January 10, 2012 @ 21:59

RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Blog at

%d bloggers like this: