You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Kevin Martin <ke...@ameritech.net> on 2006/03/10 06:29:21 UTC

question about overall build success when subant fails.

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Re-Post.

Is this the wrong list to post this to?  if so, what would be a better list?

Thanks.

Kevin

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.
> 
> Thanks.
> 
> Kevin

- ---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFEEQ6xaXZlxDxYaM4RAkUfAJ9Nw9kR8TOjTCQABh+zxR6PCo6rMgCgi7wD
QIu1uI06HWvO7XRxRF+bJZA=
=ina1
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Re: question about overall build success when subant fails.

Posted by Dominique Devienne <dd...@gmail.com>.
> 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: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org