+ -
当前位置:首页 → 问答吧 → [已解决]CentOS 5.5 apache ivy 安装后ant不能找到ivy task

[已解决]CentOS 5.5 apache ivy 安装后ant不能找到ivy task

时间:2010-08-11

来源:互联网

本帖最后由 可可火山 于 2010-08-13 12:10 编辑

尝试下载了最新的ant 1.8,ivy运行正常,可能是CentOS 源里的ant有些配置上的区别。



最近在学习hadoop,hadoop: the definiteve guide 一书的例子代码里用到ivy,我通过下载解压把ivy.jar放到了ANT_HOME/lib下,照理应该可以work了吧。

ant是1.65来自yum源。


现在报
htdg-examples-0.1.1/build.xml:77: Could not create task or type of type: antlib:org.apache.ivy.ant:retrieve.

以下是我的错误信息:
  1. [user@/opt/workspace/hadoopdefiniteveguide/htdg-examples-0.1.1 (0)]$ ls /usr/share/ant/lib/
  2. ivy.jar  jsch.jar
  3. [user@/opt/workspace/hadoopdefiniteveguide/htdg-examples-0.1.1 (0)]$ ant -version
  4. Apache Ant version 1.6.5 compiled on January 6 2007
  5. [user@/opt/workspace/hadoopdefiniteveguide/htdg-examples-0.1.1 (0)]$ java -version
  6. java version "1.6.0_20"
  7. Java(TM) SE Runtime Environment (build 1.6.0_20-b02)
  8. Java HotSpot(TM) Client VM (build 16.3-b01, mixed mode, sharing)
  9. [user@/opt/workspace/hadoopdefiniteveguide/htdg-examples-0.1.1 (0)]$ ant
  10. Buildfile: build.xml

  11. init:

  12. retrieve-dependencies:

  13. BUILD FAILED
  14. /opt/workspace/hadoopdefiniteveguide/htdg-examples-0.1.1/build.xml:77: Could not create task or type of type: antlib:org.apache.ivy.ant:retrieve.

  15. Ant could not find the task or a class this task relies upon.

  16. This is common and has a number of causes; the usual
  17. solutions are to read the manual pages then download and
  18. install needed JAR files, or fix the build file:
  19. - You have misspelt 'antlib:org.apache.ivy.ant:retrieve'.
  20.    Fix: check your spelling.
  21. - The task needs an external JAR file to execute
  22.      and this is not found at the right place in the classpath.
  23.    Fix: check the documentation for dependencies.
  24.    Fix: declare the task.
  25. - The task is an Ant optional task and the JAR file and/or libraries
  26.      implementing the functionality were not found at the time you
  27.      yourself built your installation of Ant from the Ant sources.
  28.    Fix: Look in the ANT_HOME/lib for the 'ant-' JAR corresponding to the
  29.      task and make sure it contains more than merely a META-INF/MANIFEST.MF.
  30.      If all it contains is the manifest, then rebuild Ant with the needed
  31.      libraries present in ${ant.home}/lib/optional/ , or alternatively,
  32.      download a pre-built release version from apache.org
  33. - The build file was written for a later version of Ant
  34.    Fix: upgrade to at least the latest release version of Ant
  35. - The task is not an Ant core or optional task
  36.      and needs to be declared using <taskdef>.
  37. - You are attempting to use a task defined using
  38.     <presetdef> or <macrodef> but have spelt wrong or not
  39.    defined it at the point of use

  40. Remember that for JAR files to be visible to Ant tasks implemented
  41. in ANT_HOME/lib, the files must be in the same directory or on the
  42. classpath

  43. Please neither file bug reports on this problem, nor email the
  44. Ant mailing lists, until all of these causes have been explored,
  45. as this is not an Ant bug.

  46. Total time: 1 second
复制代码

作者: 可可火山   发布时间: 2010-08-11

学习。没有这么配置过。

作者: renxiao2003   发布时间: 2010-08-28