ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Olivier Gies <>
Subject Re: How to run an ant target on success/failed build
Date Wed, 23 Jul 2008 01:48:12 GMT
One solution is to use ant-contrib's <trycatch> task:

1) Direct usage:
		<!-- Your code here -->

		<mail message="Success" ... >
		<mail message="Failure" ... >

2) If you need the failure message in the mail (in combination with 
ant-contrib's <if>):

<trycatch property="errormessage">
		<!-- Your code here -->

	<not><isset property="errormessage"/></not>
		<mail message="Success" ... >
		<mail message="Failure: ${errormessage}" ... >

See for more 


*Olivier Gies*

*Delivery Manager
Customs & Tax Software Engineering Center
Bull, Architect of an Open World ^TM
Phone: +86 (10) 65978001 - Ext 555 *

* <>*

*This e-mail contains material that is confidential for the sole use of
the intended recipient. Any review, reliance or distribution by others
or forwarding without express permission is strictly prohibited. If you
are not the intended recipient, please contact the sender and delete all

-------- Original Message  --------
Subject: How to run an ant target on success/failed build
From: p2008 <>
Date: 23/07/2008 06:36

> I need to be able to trigger running a specific ant target when the build
> succeeds, and another one when it fails.  This will be used to send out an
> email indicating the status of the build.
> I have done this in the past in nant (.NET) which has a built in property
> called nant.onsuccess and one called nant.onfailure.  
> Is there something similar in ant, or any does anybody know how to do this?
> Thanks!

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

View raw message