0
以下是build.xml文件中的代碼拋出錯誤。我搜索了一下,發現了一些解決方案,比如..添加ant contrib jar文件來解決問題。即使在添加jar文件後也面臨同樣的問題。請參閱下面的代碼。從源代碼構建項目時ant失敗
<target name="copyHtdocs" depends="init">
<export srcUrl="${svn.htdocs.url}" revision="HEAD" destPath="${htdocs.dir}" />
<export srcUrl="${svn.htdocs.url}" destPath="${htdocs.dir}"/>
</target>
新增螞蟻的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.