Re: error handling in ant
On Nov 13, 5:28 am, Lew <l...@lewscanon.com> wrote:
Multiposted message unified.
Vitvitskiy Vladimir wrote:
Hi all, does ant have possibility to handle errors ?
To be clear, i try to use oracle ant ext to redeploy oc4j war/ear
application
Ant when app is not deployed "redeploy" task throws me failure --> i want
then deploy ...
How can i make it use this workflow ? Thanks
It Depends.
My first thought would be to avoid the failure entirely. Can you use
conditionals to detect whether something is already deployed (based
on, for example, the existence or non-existence of a file)? If so,
you can select 'redeploy' vs 'deploy' before trying either one, and
allow failures to act as they normally do.
Alternately, you might be able to write a custom task (if one doesn't
exist already, google is your friend) to handle the failure by setting
a property or evaluating another task. It's possible the task you're
using to redeploy your app has this already; check the docs for the
attributes and elements the tag supports.