2013-05-03 69 views
1

我克隆了一个新的回购库,其中包含一个build.xml,该库以弹簧工具套件(STS)在〜/ .ant/lib中安装时找不到ivy.jar,并且命令行生成成功

<?xml version="1.0"?> 

<project name="mbark" basedir=".." xmlns:ivy="antlib:org.apache.ivy.ant"> 

,但此行,当我在STS运行,

<target name="build" description="Compile main source tree java files"> 
    <ivy:retrieve type="jar"/> 

始终未能在类似这样的消息:

BUILD FAILED 
/home/myusername/Documents/workspace-sts-3.2.0.RELEASE/mbark/conf/build.xml:26: Problem: failed to create task or type antlib:org.apache.ivy.ant:retrieve 
Cause: The name is undefined. 
Action: Check the spelling. 
Action: Check that any custom tasks/types have been declared. 
Action: Check that any <presetdef>/<macrodef> declarations have taken place. 
No types or tasks have been defined in this namespace yet 

This appears to be an antlib declaration. 
Action: Check that the implementing library exists in one of: 
     -/home/myusername/springsource/sts-3.2.0.RELEASE/plugins/org.apache.ant_1.8.3.v201301120609/lib 
     -/home/myusername/.ant/lib 
     -a directory added on the command line with the -lib argument 

我可以浏览到我家的蚂蚁文件夹并找到ivy.jar;我可以从命令行构建;我也在项目中指定了ANT_HOME |属性|资源|链接的资源|路径变量(虽然我不认为这个设置会有帮助,但我做到了),但STS内部的运行蚂蚁仍然抱怨。

任何蚂蚁/常春藤专家都可以提供一些线索吗?

回答

0

您是否尝试将常春藤罐放在错误消息中列出的以下位置之一?

行动:检查实施库中的一个存在:

-/home/myusername/springsource/sts-3.2.0.RELEASE/plugins/org.apache.ant_1.8.3.v201301120609/lib 
    -/home/myusername/.ant/lib 

你的问题是,Eclipse有它的管理ANT自己的机制。它将忽略ANT_HOME环境变量。

有关详细信息(以及可能的变通)请参见下面的答案:

+0

我确实安装了ivy.jar。使用ant和build.xml命令行构建完美。 – xiaochuanQ 2013-05-06 14:59:29

1

从您的STS窗口,进入到 “窗口” - > “首选项”,并确保所有的ant jar文件都在那里列出,并确保这些蚂蚁罐子的路径是正确的。 enter image description here

相关问题