ant-contrib停止被认可

时间:2012-09-06 08:33:23

标签: ant

Ant无法找到ant贡献者,我很困惑,因为我不记得在机器上改变任何东西。

$ ant -f ./build-ivy.xml 
Buildfile: ./build-ivy.xml
  [taskdef] Could not load definitions from resource net/sf/antcontrib/antlib.xml. It could not be found.

BUILD FAILED
/var/lib/jenkins/jobs/Lakshmi-MySQL/workspace/build-ivy.xml:41: Problem: failed to create task or type antlib:org.apache.ivy.ant:settings
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
        -/var/lib/jenkins/.ant/lib
        -a directory added on the command line with the -lib argument

现在ant-contrib jar文件(如前所述)在/var/lib/jenkins/.ant/lib中,并且可供用户阅读

$ ls -l /var/lib/jenkins/.ant/lib/ant-contrib-1.0b3.jar
-rw-r--r-- 1 jenkins root 224277 Jun 29 09:24 /var/lib/jenkins/.ant/lib/ant-contrib-1.0b3.jar
$ jar tf /var/lib/jenkins/.ant/lib/ant-contrib-1.0b3.jar | head -n 3
META-INF/
META-INF/MANIFEST.MF
net/

修改

用strace检查:ant 读取文件:

...
[pid 10400] stat("/var/lib/jenkins/.ant/lib/ant-contrib-1.0b3.jar", {st_mode=S_IFREG|0644, st_size=224277, ...}) = 0
[pid 10400] stat("/var/lib/jenkins/.ant/lib/ant-contrib-1.0b3.jar", {st_mode=S_IFREG|0644, st_size=224277, ...}) = 0
[pid 10400] open("/var/lib/jenkins/.ant/lib/ant-contrib-1.0b3.jar", O_RDONLY) = 15
[pid 10400] fstat(15, {st_mode=S_IFREG|0644, st_size=224277, ...}) = 0
[pid 10400] fcntl(15, F_GETFD)          = 0
[pid 10400] fcntl(15, F_SETFD, FD_CLOEXEC) = 0
[pid 10400] lseek(15, 0, SEEK_END)      = 224277
[pid 10400] lseek(15, 224149, SEEK_SET) = 224149
[pid 10400] read(15, "ls/Walls.classPK\1\2\24\3\n\0\0\0\10\0\323]b5\362j"..., 128) = 128
[pid 10400] mmap(NULL, 19477, PROT_READ, MAP_SHARED, 15, 0x32000) = 0x7fb234002000
[pid 10400] lseek(15, 43, SEEK_SET)     = 43
[pid 10400] read(15, "PK\3\4\n\0\0\0\10\0\322]b5\214\246\227\251\206\0\0\0\240\0\0\0\24\0\0\0", 30) = 30
[pid 10400] lseek(15, 93, SEEK_SET)     = 93
[pid 10400] read(15, "M\215\261\16\203 \24Ew\22\376\341\215\355\0>\264\222\224M;upj\323\265A\304\224\244\240\1"..., 134) = 134
...

1 个答案:

答案 0 :(得分:2)

未设置

ANT_HOME这导致ant 1.8.4安装中的ant脚本执行默认的ant 1.7.1二进制文件(不能与ant-contrib一起使用)

ANT_HOME设置为ant 1.8.4安装后,一切都按预期工作。