2012-09-06 49 views
1

螞蟻沒有更多的能夠找到螞蟻的貢獻,我很困惑,因爲我沒有記得改變機器上的任何東西。ant-contrib停止被識別

$ 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 

現在螞蟻的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檢查:螞蟻讀該文件:

... 
[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 
... 

回答

2

ANT_HOME沒有設置這引起了ant腳本螞蟻1.8.4安裝執行默認螞蟻1.7.1二進制(不與螞蟻的contrib工作)

設置ANT_HOME螞蟻1.8.4後安裝一切都按預期工作。