0

在我的 ant 中执行此操作时出现错误,我不明白为什么 ant 无法识别任务类路径:

<?xml version="1.0"?>

<project default="task">

<target name="task">
    <classpath>
        <pathelement path="." />
    </classpath>
</target>

</project>

我有错误消息:

task:

BUILD FAILED
C:\way\build.xml:6: Problem: failed to create task or type classpath
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.

有人知道错误来自哪里吗?

4

1 回答 1

0

Ant中没有classpath任务(尽管某些任务确实允许您指定类路径。您可以使用该任务测试基本的 Ant 构建path,作为替代方案:

<?xml version="1.0"?>

<project default="task">

<target name="task">
    <path id  = "class.dirs.path">
        <dirset dir  = "${build}" includes = "class.dir.list" />
    </path>
</target>
</project>
于 2013-02-18T19:06:20.097 回答