Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/ant/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 运行ant目标时出错_Java_Ant_Junit_Target - Fatal编程技术网

Java 运行ant目标时出错

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

因此,我在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>
由于完全缺少日志,我无法找出错误所在。
如何让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>