2014-05-20 21 views
0

我写了下面的build.xml文件的JUnit目标,错误:JUnitTask不支持嵌套的文本数据(;)

<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> 

构建路径有所有的罐子包括JUnit罐子。 当我执行这个目标时,它会抛出以下错误。有人可以建议我在这里错过什么吗?

JUnit版本:4.10 错误:

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

回答

2

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

+0

谢谢,那是正确的! – user85