Question

I'm currently using ANT for building my Java project on a Windows XP machine. In my build.xml file I've defined 3 task and I would like that,in case of fail,a default task be executed before closing the building and exiting (like a recovery procedure). I would like to know if it's possible.

thanks

Was it helpful?

Solution

Googled and found this. It's basically a try/catch for Ant. Might be worth a look: http://ant-contrib.sourceforge.net/tasks/tasks/trycatch.html

OTHER TIPS

Never heard of such a property/task, but the follwing just comes to my mind: you could use an additional 'Master' ant script.

  • The master script (a new one) includes all public targets from the original one and delegates the work to the corresponding task in your build script (ant calls)
  • If the delegate fails, the master should be able to recognize the failure and could call the 'clean-up' task (either on the 'master' or on the original build file)
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top