错误:JUnitTask不支持嵌套文本数据(;)

时间:2014-05-20 11:45:13

标签: ant junit4

我在build.xml中编写了junit目标,

<target name="test-1" depends="compile">
  <junit printsummary="yes" haltonfailure="yes">
    <classpath refid="build.classpath"/>          
    <test name="com.sample.CalcTest"
             haltonfailure="no" outfile="result" todir="${test.report.dir}">
      <formatter type="plain"/>;
      <formatter type="xml"/>
    </test>
  </junit>
</target>

build-path包含所有jar包括junit jar。 当我执行此目标时,它会抛出以下错误。有人可以建议我在这里缺少什么吗?

Junit版本:4.10 ERROR:

class org.apache.tools.ant.taskdefs.optional.junit.JUnitTask doesn't support nested text data (;).

1 个答案:

答案 0 :(得分:2)

;之后您有不必要的<formatter type="plain"/>,请将其删除。

相关问题