ant-contrib post任务无效

时间:2013-09-18 07:36:05

标签: java ant build ant-contrib

我的构建脚本中有以下任务。

<target name="upload" depends="init">
    <taskdef resource="net/sf/antcontrib/antlib.xml"/> 
    <post to="http://testapp.com/api/builds.format" verbose="true" wantresponse="true" maxwait="0">
        <prop name="file" value="./release/temp.ipa"/>
        <prop name="notes" value="release notes"/>
    </post>
</target>

我从我的mac机器运行这个构建脚本。它给出了以下错误。

Problem: failed to create task or type post
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.

我已经下载了ant-contrib-0.3.jar并将其复制到ANT_HOME / lib目录,其中ANT_HOME是/ usr / share / ant。

当我搜索网络here时,他们要求使用ant-contrib-version.jar以及使用源自己构建jar。但我无法在该源中运行ant脚本,因为它会抛出一些错误。

有人可以指导我解决这个问题。

1 个答案:

答案 0 :(得分:4)

ant-contrib-0.3.jar是Ant-Contrib的一个非常古老的版本。其中不存在<post>任务。

相反,您会在最新版本的Ant-Contrib中找到<post>ant-contrib-1.0b3