У меня есть целевой тест с именем, и я хочу сделать некоторые тесты.
Я помещаю здесь важные части в build.xml. Он включает в себя:
<property name='lib.dir' value='lib' />
<path id='classpath'>
<fileset dir="${lib.dir}" includes="**/*.jar" />
</path>
И я положил junit.jar и ant -junit.jar (это обязательный?) в каталоге lib.
Однако, если я запустил
ant test
.
Ошибка вывода:
test:
BUILD FAILED
/home/xiaohan/EclipseWorkSpace/AntTest/build.xml:82: Problem: failed to create task or type junit
Cause: the class org.apache.tools.ant.taskdefs.optional.junit.JUnitTask was not found.
This looks like one of Ant optional components.
Action: Check that the appropriate optional JAR exists in
-/usr/share/ant/lib
-/home/xiaohan/.ant/lib
-a directory added on the command line with the -lib argument
Do not panic, this is a common problem.
The commonest cause is a missing JAR.
This is not a bug; it is a configuration problem
Кроме того, если я помещаю два файла jar в /usr/share/ant/lib с помощью набора $ANT_HOME, он все равно не работает.
Действительно спасибо за любые подсказки