【问题标题】:Task classpath in ant : Javaant 中的任务类路径:Java
【发布时间】:2013-02-18 18:55:02
【问题描述】:

我在我的 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.

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

【问题讨论】:

    标签: java ant classpath task


    【解决方案1】:

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

    <?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>
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2012-05-06
      • 1970-01-01
      • 1970-01-01
      • 2010-10-14
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2023-04-06
      相关资源
      最近更新 更多