ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Lenhof,Danny" <>
Subject RE: How to stop ant execution if one target fails
Date Thu, 02 Oct 2008 16:45:58 GMT
You may want to use something like this.... <fail unless="workspace"
message="The workspace property needs to be set!"/>

-----Original Message-----
From: Dean Del Ponte [] 
Sent: Thursday, October 02, 2008 10:25 AM
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.
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:
For additional commands, e-mail:

View raw message