在搭建ant环境的时候,ant环境变量已经配置完成,但是在eclipse的ant窗口中运行build.xml的get-lib方法的是却报错了,报错信息如下:
BUILD FAILED E:\workspace\int_0.1.0\build.xml:38: Problem: failed to create task or type antlib:org.apache.ivy.ant:configure 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: -E:\sts-3.6.4.RELEASE\plugins\org.apache.ant_1.9.2.v201404171502\lib -C:\Users\Administrator.6LIGUDDGSQZVGFK\.ant\lib -a directory added on the command line with the -lib argument
在网上也查了,大多数的说法是编译问题或是缺少jar包,最终问同事他问在eclipse添加ant HOME了没?才恍然大悟,如下图,没有添加home当然会有编译问题,但问题也很容易解决就是在下图中的Ant Home中关联ant文件夹就可以了,问题解决。