【问题标题】:Problem: failed to create task or type thrift because ant-contrib-1.0b3.jar is missing问题:由于缺少 ant-contrib-1.0b3.jar,无法创建任务或键入 thrift
【发布时间】:2020-06-19 06:07:52
【问题描述】:

当我使用 Ant 在 Eclipse 上构建我的项目时,它可以工作。但是当我使用 Jenkins 时,我遇到了这个错误:

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

我发现它一定是因为一个外部 jar:ant-contrib-1.0b3.jar,它丢失了。在 Eclipse 上,我配置了 window/preferences/ant/runtime 并添加了我的外部 jar,但我不知道如何使用 Jenkins。

你知道我可以在配置的哪个位置添加这个 jar 吗?

提前致谢

【问题讨论】:

    标签: java jenkins jar ant


    【解决方案1】:

    jar 可以位于系统的任何位置;您只需在 build.xml 中添加一个 taskdef 步骤,其中包含指向它的 classpath。见http://ant-contrib.sourceforge.net/

    <taskdef resource="net/sf/antcontrib/antcontrib.properties">
        <classpath>
            <pathelement location="/path/to/ant-contrib-1.0b3.jar"/>
        </classpath>
    </taskdef>
    

    也就是说,据我所知,ant-contrib 不包含thrift 任务。这是 ant-contrib 添加的所有额外任务的列表:http://ant-contrib.sourceforge.net/tasks/tasks/index.html

    也许您正在寻找这个? https://github.com/ehrmann/thrift-task

    【讨论】:

      猜你喜欢
      • 2011-09-24
      • 1970-01-01
      • 2019-07-01
      • 2019-06-27
      • 2015-10-28
      • 2015-08-11
      • 1970-01-01
      • 2016-01-02
      • 1970-01-01
      相关资源
      最近更新 更多