继续执行ant脚本,如果一个任务失败 [英] Continue executing ant script if one task fails

查看:176
本文介绍了继续执行ant脚本,如果一个任务失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有它运行的测试,然后部署我的应用程序到服务器QA一个Ant脚本。部署应用程序,首先要调用太阳的appserv取消部署,由于各种原因,应用程序可能会或可能不会进行部署。如果应用程序没有将其部署取消部署失败,整个脚本暂停。

I have an Ant script which runs tests then deploys my application to a QA server. To deploy the application it first calls sun-appserv undeploy, for various reasons the application may or may not be deployed. If the application is not deployed then undeploy fails and the whole script halts.

有没有一些方法,我可以容忍一个失败的一个任务,记录它,并让脚本的其余部分运行?

Is there some way that I can tolerate a failure on one task, log it, and let the rest of the script run?

推荐答案

AntContrib尝试美中不足的是:

AntContrib try catch:

<try>
   <!-- do deployment getting return code -->
</try>
<catch>
   <!-- echo the return code with a message -->
</catch>

Exec任务有,你可以设置为false继续去一个failonerror属性。

The exec task has a failonerror attribute which you can set to false to keep going.

这篇关于继续执行ant脚本,如果一个任务失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆