ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dominique Devienne <>
Subject RE: How do I force ant to fail?
Date Thu, 09 May 2002 20:16:00 GMT
I think the error code of the program <exec>'ed can now be captured with ANT
1.5beta... Check it out. --DD

-----Original Message-----
From: Neal Myerson []
Sent: Thursday, May 09, 2002 1:47 PM
Subject: How do I force ant to fail?

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 simple:
    <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
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