[英]error running ant target
所以我在build.xml文件中的新目標遇到了麻煩
<target name="consistency">
<description>Consistency</description>
<junit printsummary="withOutAndErr" haltonfailure="yes" haltonerror="yes" dir="${basedir}" showoutput="true" fork="yes" forkmode="once">
<classpath refid="build.classpath" />
<batchtest todir="${test.dir}">
<fileset dir="${test.src.dir}/com/the/dir/is/correct/">
<include name="ConsistencyCase.java" />
</fileset>
</batchtest>
</junit>
由於錯誤而失敗:
[junit] Running ConsistencyCase
[junit] Tests run: 1, Failures: 0, Errors: 1, Time elapsed: 0 sec
BUILD FAILED
D:\Users\myusername\workspace\projectname\build.xml:410: Test ConsistencyCase failed
Total time: 1 second
由於完全缺少日志,我無法弄清楚錯誤在哪里。 如何讓Ant刷新一些錯誤日志?
您可以使用以下格式器:
<target name="consistency">
<description>Consistency</description>
<junit printsummary="withOutAndErr"
haltonfailure="yes"
haltonerror="yes"
dir="${basedir}"
showoutput="true"
fork="yes" forkmode="once">
<classpath refid="build.classpath" />
<formatter type="plain" usefile="false" />
<batchtest todir="${test.dir}">
<fileset dir="${test.src.dir}/com/the/dir/is/correct/">
<include name="ConsistencyCase.java" />
</fileset>
</batchtest>
</junit>
</target>
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.