You may want to use something like this.... <fail unless="workspace"
message="The workspace property needs to be set!"/>

-Danny
-----Original Message-----
From: Dean Del Ponte [mailto:[EMAIL PROTECTED] 
Sent: Thursday, October 02, 2008 10:25 AM
To: user@ant.apache.org
Subject: How to stop ant execution if one target fails

I'm using ant to build my project.  When running ant from the command
line, I'm passing in multiple targets.  For example:

     ant -verbose clean build jar findbugs pmd

Ant will execute the targets clean, build, jar, findbugs, and pmd in
that order.

My problem is that if one of the targets fail, ant continues with the
next target.  I would like it to stop execution if one fails.

For example, if the "jar" target fails, ant should not call the findbugs
and pmd targets.

Any help is appreciated.

Dean Del Ponte
Software Consultant, Cornerstone Consulting, Inc.
www.cornerstone.net
Our Experts. Your Edge


This e-mail message, including any attachments, is for the sole use of the 
person to whom it has been sent, and may contain information that is 
confidential or legally protected. If you are not the intended recipient or 
have received this message in error, you are not authorized to copy, 
distribute, or otherwise use this message or its attachments. Please notify the 
sender immediately by return e-mail and permanently delete this message and any 
attachments.  Gartner makes no warranty that this e-mail is error or virus 
free. 


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to