Java 运行ant目标时出错
因此,我在build.xml文件中遇到了一些新目标问题Java 运行ant目标时出错,java,ant,junit,target,Java,Ant,Junit,Target,因此,我在build.xml文件中遇到了一些新目标问题 <target name="consistency"> <description>Consistency</description> <junit printsummary="withOutAndErr" haltonfailure="yes" haltonerror="yes" dir="${basedir}" showoutput="true" fork="yes" forkmode="once
<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>
由于完全缺少日志,我无法找出错误所在。
如何让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>
一致性
<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>