【发布时间】:2018-09-12 03:35:28
【问题描述】:
我遇到了 Ant 问题。我在 build.xml 中使用 xmlvalidate 标记。
<xmlvalidate file="${basedir}/**/@{filename}" failonerror="true">
<attribute name="http://xml.org/sax/features/validation" value="true" />
<attribute name="http://apache.org/xml/features/validation/schema" value="true" />
<attribute name="http://xml.org/sax/features/namespaces" value="true" />
</xmlvalidate>
我收到以下错误
Problem: failed to create task or type xmlvalidate
[ERROR] Cause: the class org.apache.tools.ant.taskdefs.optional.XMLValidateTask was not found.
[ERROR] This looks like one of Ant's optional components.
[ERROR] Action: Check that the appropriate optional JAR exists in
[ERROR] -ANT_HOME\lib
我对此进行了很多探索并尝试了一些建议: 1)我搜索了包含 org.apache.tools.ant.taskdefs.optional.XMLValidateTask 的 jar 文件(添加了 ant-optional-1.5.1.jar)并添加到 ANT_HOME\lib 文件夹中,因为它在错误。 2)我现在用的是ant 1.9.7,更新到1.10.5。
使用任何一个选项我都没有成功。
从错误中我了解到的只是缺少一些 jar..
请帮助解决这个问题。提前感谢您的时间...
【问题讨论】: