ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kyle Adams" <>
Subject Re: How do I force ant to fail?
Date Thu, 09 May 2002 20:18:13 GMT

>>> 05/09/02 02:47PM >>>
Summary: I'm trying to write some checkin tests using Ant. They use jdk14, so I do a simple
recusion to make sure JAVA_HOME is set properly. if="jdk1.4", I then run the tests with a
    <java classname="jbtest.JBTestRunner" fork="yes" failonerror="true"> .... </java>
Works great. When the tests fail, I get a BUILD FAILED from Ant, just like I want!
Except... to set jdk1.4 I had called:
    <exec executable="${antexec}" dir="." failonerror="true">
      <env key="JAVA_HOME" value="../build/jdk1.4"/>
      <arg value="${targetName}"/>
And this I cannot get to fail. So even when the nested Ant script fails, this one still succeeds,
even though I have a failonerror set. I assume it's because the exec actually does succeed,
it's just the ant script that was called from it that failed. 
Does this make sense? How can I get the outer Ant script to fail. Or more to the point, when
my tests fail I want total system failure. I want it to say BUILD FAILED and just stop. 
Any ideas?


To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message