我在 os x 服务器(Lion)上安装了一个 jenkins,我希望它调用一个 ant 脚本来编译一个单一的示例项目。
安装有一个专用用户“jenkins”,如果我从 ssh 实例登录他,我可以成功运行编译任务(使用 ivy 的任务):
jenkins>ant compile
当 Web 界面调用 ant 时出现问题,出现以下错误:
Problem: failed to create task or type antlib:org.apache.ivy.ant:resolve
原因:ant 没有从库中正确加载 ivy 的解析任务。我真的无法理解修复。我确信 jenkins 以“jenkins”用户身份运行命令。
编辑:更多信息
BUILD FAILED
/Users/Shared/Jenkins/Home/jobs/example-build/workspace/build.xml:19: Problem: failed to create task or type antlib:org.apache.ivy.ant:resolve
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.
No types or tasks have been defined in this namespace yet
This appears to be an antlib declaration.
Action: Check that the implementing library exists in one of:
-/usr/share/ant/lib
-/Users/Shared/Jenkins/Home/.ant/lib
-a directory added on the command line with the -lib argument
Total time: 0 seconds
Build step 'Invoke Ant' marked build as failure
Finished: FAILURE