java Ant Junit不断给出ClassNotFoundException
我只是对这项任务感到失望。我知道这个问题已经解决了,但其他问题没有解决
我的目录结构
bin
- dist (jars)
- classes (classes)
- Project1
- com
- jc
- pri
- core
- Account.class
- tmp (reports of junit)
Main App
- source
- Project1
- src
- com
- jc
- pri
- core
- Account.java
junit.jar
属性: bin_dir=/箱子 base_dir=/
构建。xml:
<path id=ju.cp">
<pathelement location="junit.jar" />
<pathelement location="${bin_dir}/classes" />
</path>
<target name="test">
<junit haltonfailure="yes">
<classpath refid="ju.cp">
<formatter type="xml" />
<batchtest todir="${bin_dir}/tmp">
<fileset dir="{base_dir}/Main App/source/Project1/src">
<include name="**/*.java" />
</fileset>
</junit>
</target>
输出/xml文件中出现错误:
<error message="com.jc.pri.core.Account" type="java.lang.ClassNotFoundException">java.lang.ClassNotFoundException: com.jc.pri.core.Account
at java.net.URLClassLoader.findClass(URLClassLoader.java:382)
..
..
..
..
at java.lang.Class.forName(class.java:348)
</error>
Ant版本:1.10.6
共 (0) 个答案