蚂蚁全成甚至当Ant任务失败 [英] Ant Successfull Even When Ant Task Fails

查看:187
本文介绍了蚂蚁全成甚至当Ant任务失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

必须有一个简单的设置我缺少所以请原谅我,但我已经注意到在两种情况下,我的坏Ant任务不会导致生成失败。例如:

There must be a simple setting I am missing so forgive me, but I've noticed on two occasions that my bad ant tasks do not cause the build to fail. For example:


  1. 在源文件不存在蚂蚁副本... BUILD SUCCESSFUL

  1. Ant copy when source file does not exist ... BUILD SUCCESSFUL

蚂蚁解压缩,当任务报告不能写入文件或类似的消息... BUILD SUCCESSFUL

Ant unzip, when task reports "can't write file" or similar message ... BUILD SUCCESSFUL

蚂蚁EXEC错误,无效的语法...... BUILD SUCCESSFUL

Ant exec error, invalid syntax ... BUILD SUCCESSFUL

如何,我保证会导致构建失败的所有Ant任务的错误?

推荐答案


  • <&EXEC GT; 任务将默认情况下没有失败。您需要启用此 failonerror =真正的

  • <EXEC> tasks do no fail by default. You need to enable this with failonerror="true"

    Ant的&LT的故障; COPY&GT; 任务取决于使用什么资源集合类型。如果使用文件集 patternset ,那么所有丢失的文件的自动忽略。您只能使用强制故障文件清单:键入或使用参数化的'file`属性。

    Failure of the Ant <COPY> task depends on what resource collection type is used. If you use a fileset or patternset, then all missing files are silently ignored. You can force a failure only by using the filelist type or the parameterized 'file` attribute is used.

    因此​​,你要使用的可以是:

    Therefore what you want to use is either:

    <copy todir="my_dir" file="foo" />
    
    <copy todir="my_dir" flatten="true">
      <filelist dir="" files="foo" />
    </copy>
    
    <copy todir="my_dir" flatten="true">
      <filelist dir="">
         <file name="foo" />
         <file name="bar" />
         <file name="zed" />
      </filelist>
    </copy>
    


  • 这篇关于蚂蚁全成甚至当Ant任务失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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