2013-05-17 61 views
4

我正在哈德遜運行一個Job。 我從哈德森主服務器構建這項工作,但工作內置在哈德森Linux節點中。 這是結果:java.io.IOException:無法運行程序「ant」

Started by user builder 
Building remotely on Linux-Node 
Updating http: // Server/branches revision: 17-may-2013 16:01:46 depth:infinity ignoreExternals: false 
At revision 529 
Updating http: // Server/branches revision: 17-may-2013 16:01:46 depth:infinity ignoreExternals: false 
At revision 529 
no change for http: // Server/branches since the previous build 
no change for http: // Server/branches since the previous build 
No emails were triggered. 
[bt] $ ant -file build.xml -DSUBSYSTEM=ALL -DTARGET=makeBuild -DCRLIST= -DOWNER= -DbuildTool.patch.release=$RELEASE -DbuildTool.system=$SYSTEM -DbuildTool.patch.type=$PATCH_TYPE -DbuildTool.subsystem=ALL -DbuildTool.buildRules=pkgBuild -DbuildTool.dynamicView=$WORKSPACE/ALL -DbuildTool.compilationRules=compile -DbuildTool.patch.name=$PATCH_NAME makeBuild 
FATAL: command execution failed.Maybe you need to configure the job to choose one of your Ant installations? 
java.io.IOException: Cannot run program "ant" (in directory "/hudson/buildTool/src/bt"): error=2, No existe el fichero o el directorio 
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1029) 
at hudson.Proc$LocalProc.<init>(Proc.java:192) 
at hudson.Proc$LocalProc.<init>(Proc.java:164) 
at hudson.Launcher$LocalLauncher.launch(Launcher.java:639) 
at hudson.Launcher$ProcStarter.start(Launcher.java:274) 
at hudson.Launcher$RemoteLaunchCallable.call(Launcher.java:794) 
at hudson.Launcher$RemoteLaunchCallable.call(Launcher.java:768) 
at hudson.remoting.UserRequest.perform(UserRequest.java:114) 
at hudson.remoting.UserRequest.perform(UserRequest.java:48) 
at hudson.remoting.Request$2.run(Request.java:283) 
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) 
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334) 
at java.util.concurrent.FutureTask.run(FutureTask.java:166) 
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) 
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) 
at java.lang.Thread.run(Thread.java:722) 
Caused by: java.io.IOException: error=2, No existe el fichero o el directorio 
at java.lang.UNIXProcess.forkAndExec(Native Method) 
at java.lang.UNIXProcess.<init>(UNIXProcess.java:135) 
at java.lang.ProcessImpl.start(ProcessImpl.java:130) 
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1021) 
... 15 more 

你知道一些關於這個問題?

感謝和問候

+0

當然,Ant是安裝在classpath中的嗎? –

+1

你檢查過這個嗎? http://stackoverflow.com/questions/5092479/ant-with-hudson – fGo

+0

是的fGo我讀了,但我沒有找到解決方案。螞蟻安裝在這裏:/usr/apache-ant/apache-ant-1.8.2/和$ PATH是:/usr/apache-ant/apache-ant-1.8.2/bin – garci86

回答

2

這是一個比較安全的做法是指以絕對路徑的可執行文件。請使用${ANT_HOME}/bin/ant來代替螞蟻。確保變量已被適當定義。

相關問題