[英]ant: resource in jar could not be found. failed to create task or type classpath
[英]Problem: failed to create task or type thrift because ant-contrib-1.0b3.jar is missing
當我使用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 嗎?
提前致謝
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
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.