Ant task doesn't work in Eclipse
来源:互联网 发布:服装公司 软件开发 编辑:程序博客网 时间:2024/05/16 10:25
build.xml
file in Eclipse, the <junit> task will not work by default. If you attempt to use the <junit> task with a fresh install of Eclipse, you will receive the following error message:BUILD FAILED: [ECLIPSE_DIR]/workspace/[PROJECT_DIR]/build.xml:208: Could not create task or type of type: junit.
Ant could not find the task or a class this task relies upon.
This is common and has a number of causes; the usual
solutions are to read the manual pages then download and
install needed JAR files, or fix the build file:
- You have misspelt 'junit'.
Fix: check your spelling.
- The task needs an external JAR file to execute
and this is not found at the right place in the classpath.
Fix: check the documentation for dependencies.
Fix: declare the task.
- The task is an Ant optional task and optional.jar is absent
Fix: look for optional.jar in ANT_HOME/lib, download if needed
- The task was not built into optional.jar as dependent
libraries were not found at build time.
Fix: look in the JAR to verify, then rebuild with the needed
libraries, or download a release version from apache.org
- The build file was written for a later version of Ant
Fix: upgrade to at least the latest release version of Ant
- The task is not an Ant core or optional task
and needs to be declared using <taskdef>.
Remember that for JAR files to be visible to Ant tasks implemented
in ANT_HOME/lib, the files must be in the same directory or on the
classpath
Please neither file bug reports on this problem, nor email the
Ant mailing lists, until all of these causes have been explored,
as this is not an Ant bug.
The <junit> Ant task is an optional task and this is the standard Ant error message when Ant cannot find the supporting code for an optional task. Ant includes support for the tasks themselves, but not the internal code that actually does the work.
So you need to find a copy of junit.jar
, the code that does JUnit work, and tell Ant where it is. The easiest way to do this is to go to Window --> Preferences, Ant --> Runtime
. In the Classpath
tab click on Global Entries
and then Add External JARs...
.
Eclipse already has a copy of JUnit, so in the dialog find your Eclipse plugins directory ([ECLIPSE_DIR]/plugins/
) and go to the JUnit plugin (presently org.junit_3.8.1
) and select junit.jar
. Now all of your Ant scripts will know how to do the <junit> Ant task.
Last updated September 08, 2004 at 08:27 AM EST
引自:http://www.ryanlowe.ca/blog/archives/001038_junit_ant_task_doesnt_work_in_eclipse.php
- Ant task doesn't work in Eclipse
- background-size doesn't work in IE8
- MSTest doesn’t work
- set_terminate doesn't work
- vi doesn't work
- TLS doesn't work on PPPoE in Chelan: MTU issue
- topmargin=\"0\" doesn\'t work in Firefox?
- GroupName of radiobutton doesn't work in gridview
- Dib to Bitmap doesn't work in WPF
- eclipse/tomcat: deploy doesn't work any more (ClassNotFoundException)
- Why dynamic_cast doesn't work ?
- File@CompanionFile doesn't work
- ASP Server.MapPath() doesn’t work as expected in global.asa
- eclipse插件Maven添加依赖查询无结果的解决方法(Select Dependency doesn't work)
- eclipse插件Maven添加依赖查询无结果的解决方法(Select Dependency doesn't work)
- eclipse插件Maven添加依赖查询无结果的解决方法(Select Dependency doesn't work)
- eclipse插件Maven添加依赖查询无结果的解决方法(Select Dependency doesn't work)
- eclipse插件Maven添加依赖查询无结果的解决方法(Select Dependency doesn't work)
- Eclpse中Java游戏应用程序开发
- 对象引用是怎样严重影响垃圾收集器的
- Ruby的变量
- SQL Server日期计算
- 项目管理之我见-人员管理
- Ant task doesn't work in Eclipse
- vi编辑器的使用手册
- Apache+Tomcat+Cygwin
- 使用 ClickOnce 部署 Windows 窗体应用程序
- 【MVP】Lichao Feng , MVP, GMCT, MCSE
- 响应上级领导的号召,申请一个马甲开始写Blog!
- 应用AXIS开始Web 服务之旅
- 强类型数据集问题汇总
- MSOffice小知识:Access数据库的生成、修理压缩和版本转换