Filed under: Continuous integration, Maven, — Tags: CI, Hudson, Jenkins, MAVEN_OPTS, Test automation, maven.test.failure.ignore — Thomas Sundberg — 2011-01-21
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
-Dmaven.test.failure.ignore=false
and your builds will fail instead of being marked as unstable.