【问题标题】:Could not load definitions from resource when using ant task使用 ant 任务时无法从资源加载定义
【发布时间】:2012-12-17 13:12:09
【问题描述】:

我在构建脚本中使用了 ant-contrib

<taskdef resource="net/sf/antcontrib/antcontrib.properties">
    <classpath>
        <pathelement location="ant/ant-contrib-0.6.jar"/>
    </classpath>
</taskdef>

它有效。但是,当我使用 ant 任务从另一个 ant 文件调用此脚本中的某个目标时,我得到了错误。

<ant antfile="build.xml" target="make" dir="${client.project.location}/ant"/>

请帮我解决问题。谢谢

【问题讨论】:

    标签: ant ant-contrib


    【解决方案1】:

    在你的代码中我们可以看到

     <classpath>
        <pathelement location="ant/ant-contrib-0.6.jar"/>
    </classpath>
    
    1. 您需要提供路径 location="/home/[some
      路径]/ant-contrib-0.6.jar"
    2. 你可以多做一件事,你需要复制你的 ant-contrib-0.6.jar 进入 ANT_HOME/lib 文件夹并从您的代码中完全删除您的标签。 注意:第二种选择总是更好。

    【讨论】:

      【解决方案2】:

      调用ant任务时我必须设置usenativebasedir="true"

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2013-03-15
        • 2017-08-18
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2011-12-29
        • 1970-01-01
        相关资源
        最近更新 更多