【发布时间】:2016-07-19 09:32:37
【问题描述】:
以下是 build.xml 文件中的代码抛出错误。我用谷歌搜索并找到了一些解决方案,例如..添加 ant contrib jar 文件来解决问题。即使在添加 jar 文件后也面临同样的问题。请看下面的代码。
<target name="copyHtdocs" depends="init">
<export srcUrl="${svn.htdocs.url}" revision="HEAD" destPath="${htdocs.dir}" />
<export srcUrl="${svn.htdocs.url}" destPath="${htdocs.dir}"/>
</target>
添加 Ant-contrib jar 文件:-
<taskdef resource="net/sf/antcontrib/antcontrib.properties">
<classpath>
<pathelement location="${libs.dir}/ant-contrib-0.6.jar" />
</classpath>
</taskdef>
错误:-
C:\source\xxxx\xxxx\build.xml:156: Problem: failed to create task or type export
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.
【问题讨论】: