ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dominique Devienne" <>
Subject Re: question about overall build success when subant fails.
Date Sat, 18 Mar 2006 03:12:14 GMT
> Is this the wrong list to post this to?  if so, what would be a better list?

It's the right forum. Not all question get answers though...

> Kevin Martin wrote:
> > Saw a thread from 2004 where the user had multiple subant tasks that weren't dependent
on each other so he set the
> > failonerror="false" for those tasks so the build could run all the way to completion.
 At the end of the build, ANT reported BUIlD
> > SUCCESSFUL when, in fact, one or more of the subant tasks had failed.  He asked
if there was a way that ANT would recognize that
> > subant tasks had failed and report the status as such at the end of the build. 
I found no answer for his question and I have the
> > same scenario and the same question.  If a subant task fails ANT should report the
overall build as FAILED IMHO.
> >
> > I've been unsuccessful in finding a resolution to this in the documentation but
maybe I'm just misunderstanding something.

What <subant> is missing is the ability like <java> and <exec> to pass
a propertyname to be set to something when an error is eaten up by
failonerror="true". This attribute is called resultproperty for these
tasks, and although it's not exactly the same thing you want, it's
similar enough.

If you're willing to use Ant-Contrib though, you could use its
<trycatch> around the <subant> calls, and deal with the failures
yourself. Ant won't automatically fail the master/main build at the
end, but you can given the info you record in <trycatch> and <fail>.
Not as elegant as what you propose, but I doubt its going to get
implemented, so I'd advise you the <trycatch> route. I'm rather a
proponent of the fail-the-build-if-anything-fails myself, FTR ;-) Good
luck, --DD

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

View raw message