我有一些导入另一个的ant文件。具体来说build.xml
进口一个project_default.xml
。当我尝试做一个生成我得到以下错误:找到导致蚂蚁失败的原因
Buildfile: C:\myproject\build.xml [taskdef] Could not load definitions from resource net/sf/antcontrib/antcontrib.properties. It could not be found.
BUILD FAILED C:\myproject\build.xml:14: The following error occurred while executing this line: C:\myproject\project_default.xml:17: Problem: failed to create task or type if Cause: The name is undefined. Action: Check the spelling. Action: Check that any custom tasks/types have been declared. Action: Check that any /declarations have taken place.
行报告17如下:
<if>
<contains string="${env.PROJECT_SELECTION}" substring="env.PROJECT_SELECTION" />
我还添加在build.xml
如下:
<taskdef resource="net/sf/antcontrib/antcontrib.properties">
<classpath>
<pathelement location="D:\UserData\ant-contrib-0.6-bin\lib\ant-contrib-0.6.jar"/>
</classpath>
</taskdef>
但得到了同样的错误。想知道这里有什么问题吗?
复制粘贴你的代码,仍然会得到同样的错误.'不能从资源净/ sf/antcontrib/antcontrib.properties中加载定义。' – Jim
嗨,你的build.xml文件中的任务是在执行taskdef?是真正位于“D:\ UserData \ ant-contrib-0.6-bin \ lib \ ant-contrib-0.6.jar”的jar文件吗?而不是明确地定义它,你也可以将它移动到你的ant安装目录下的lib目录中......这样你就不需要 ... –
Naytzyrhc