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?
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:
Fixed build file process:
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> <path id="application" location="${jar.dir}/${ant.project.name}.jar" /> <target name="clean"> <delete dir="${build.dir}" /> </target> <target name="compile"> <mkdir dir="${classes.dir}" /> <javac srcdir="${src.dir}" destdir="${classes.dir}" classpathref="classpath" includeantruntime="false" /> </target> <target name="jar" depends="compile"> <mkdir dir="${jar.dir}" /> <jar destfile="${jar.dir}/${ant.project.name}.jar" basedir="${classes.dir}"> <manifest> <attribute name="Main-Class" value="${main-class}" /> </manifest> </jar> </target> <target name="run" depends="jar"> <java fork="true" classname="${main-class}"> <classpath> <path refid="classpath" /> <path location="${jar.dir}/${ant.project.name}.jar" /> </classpath> </java> </target> <target name="junit" depends="jar"> <junit printsummary="no"> <classpath> <path refid="classpath" /> <path refid="application" /> </classpath> <batchtest fork="yes"> <fileset dir="${src.dir}" includes="*Test.java" /> </batchtest> </junit> </target> <target name="clean-build" depends="clean,jar" /> <target name="main" depends="clean,run,junit" /> </project>
Kind regards,
Rafael
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.