Bamboo ANT build fails yet Bamboo claims success

I have a build which failed with a compile error using ANT 1.9.3 with Bamboo 5.4 build 4206. However, Bamboo claims the build was successful. Why did Bamboo not detect the ANT failure even though the log clearly says BUILD FAILED? Could this be related to the fact that I build a jar, run unit tests, then build a jar and run unit tests?

2 answers

0 vote

Hi Marc,

Would be possible to provide your build.xml file so we can identify the steps you are taking to run your build, please?

Please, find below a sample (build.xml) to a project I have created:

<project name="HelloWorld" basedir="." default="main">
	<property name="src.dir" value="src" />
	<property name="build.dir" value="build" />
	<property name="classes.dir" value="${build.dir}/classes" />
	<property name="jar.dir" value="${build.dir}/jar" />
	<property name="main-class" value="sample.HelloWorld" />
	<property name="lib.dir" value="lib" />

	<path id="classpath">
		<fileset dir="${lib.dir}" includes="**/*.jar" />
	<path id="application" location="${jar.dir}/${}.jar" />

	<target name="clean">
		<delete dir="${build.dir}" />

	<target name="compile">
		<mkdir dir="${classes.dir}" />
		<javac srcdir="${src.dir}" destdir="${classes.dir}" classpathref="classpath" includeantruntime="false" />

	<target name="jar" depends="compile">
		<mkdir dir="${jar.dir}" />
		<jar destfile="${jar.dir}/${}.jar" basedir="${classes.dir}">
				<attribute name="Main-Class" value="${main-class}" />

	<target name="run" depends="jar">
		<java fork="true" classname="${main-class}">
				<path refid="classpath" />
				<path location="${jar.dir}/${}.jar" />

	<target name="junit" depends="jar">
		<junit printsummary="no">
				<path refid="classpath" />
				<path refid="application" />

			<batchtest fork="yes">
				<fileset dir="${src.dir}" includes="*" />

	<target name="clean-build" depends="clean,jar" />

	<target name="main" depends="clean,run,junit" />


Kind regards,


The process of compile, test, compile, test, etc was causing Bamboo to believe the build was successful. By changing the build to compile, compile, compile, test, test, test fixed the issue of Bamboo believing the build was sucessful.

Previous build file process:

  1. compile src for project a
  2. create a.jar
  3. run tests for a.jar
  4. compile src for project b
  5. create b.jar
  6. run tests for b.jar

Fixed build file process:

  1. compile src for project a
  2. create a.jar
  3. compile src for project b
  4. create b.jar
  5. run tests for a.jar
  6. run tests for b.jar

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Published May 18, 2017 in Bamboo

FAQ: How to Upgrade Bamboo Server

Bamboo 5.9 will no longer be supported after June 12, 2017. What does this mean? As part of our End of Life policy, Atlassian supports major versions for two years after the first major iteratio...

1,806 views 0 6
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you