ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From John5342 <>
Subject Re: How to stop ant execution if one target fails
Date Thu, 02 Oct 2008 19:39:15 GMT
If the names of the targets are indeed what they do then most of them should
probably always be done in a particular order in which case make each one
depend on the next similar to the following.

<target name="jar" depends="build" ....>

Then if you were to run "ant jar" then build will be automatically run
before jar and if build fails then jar will not be run. You should be able
to do this for most of your targets and then all required targets will
always be automatically run and you only call the target you actually need.

Hope that helps you.


2008/10/2 Dean Del Ponte <>

> 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

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message