我遇到了ant的编译问题,这里找不到junit.jar是我的构建文件:
<path id="lib">
<fileset dir="library">
<include name="*.jar" />
</fileset>
</path>
<target name="test">
<mkdir dir="tmp/reports" />
<mkdir dir="tmp/build" />
<javac srcdir="test" destdir="tmp/build" includeantruntime="false">
<classpath refid="lib" />
</javac>
<echo message="Build done" />
<junit fork="yes" haltonfailure="yes">
<batchtest todir="tmp/reports">
<fileset dir="tmp/test">
<include name="*.java" />
</fileset>
</batchtest>
<formatter type="xml" usefile="true"/>
<classpath refid="test.classpath" />
</junit>
</target>
我不确定我理解,因为-verbose
模式下的蚂蚁确实找到了我JUnit jar看到附带的截图:
答案 0 :(得分:2)
这应该在Ant中编译好。确保您使用的是最新版本的JUnit。旧版本(例如3.8.1)具有与JUnit 4.x不同的包层次结构。