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

classpathAnt にはタスクがありません(一部のタスクではクラスパスを指定できますが)。別の方法として、タスクを使用して基本的な 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 に答える