小编典典

詹金斯无法在MAC从站中调用ANT

jenkins

Jenkins master正在Windows上运行。我已经使用java
webstart将MAC连接为jenkins从属服务器。我已经在从站(MAC)中安装了ANT,并相应地更新了PATH。我能够在从属计算机中本地运行ant程序。

当我从詹金斯(Jenkins)运行作业时,它没有调用蚂蚁,并且失败并出现以下错误。请澄清。

Building remotely on QAXXX in workspace /Users/uselvvi/jenkins/workspace/QG_LOCALIZATION_STAGING
Cleaning up /Users/uselvvi/jenkins/workspace/QG_LOCALIZATION_STAGING/.
Updating https://<SVNRepo>/SVN at revision '2014-03-24T15:55:41.180 -0500'
At revision 1196
no change for  https://<SVNRepo>/SVN since the previous build
[QG_LOCALIZATION_STAGING] $ ant -DLOCALE=en_US -DBROWSER=IE -DENVIRONMENT=QA1 -DSUITE=STAGING RunTestNGSuite
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 "/Users/uselvvi/jenkins/workspace/QG_LOCALIZATION_STAGING"): error=2, No such file or directory
  at java.lang.ProcessBuilder.start(ProcessBuilder.java:1042)
  at hudson.Proc$LocalProc.<init>(Proc.java:244)
  at hudson.Proc$LocalProc.<init>(Proc.java:216)
  at hudson.Launcher$LocalLauncher.launch(Launcher.java:773)
  at hudson.Launcher$ProcStarter.start(Launcher.java:353)
  at hudson.Launcher$RemoteLaunchCallable.call(Launcher.java:998)
  at hudson.Launcher$RemoteLaunchCallable.call(Launcher.java:965)
  at hudson.remoting.UserRequest.perform(UserRequest.java:118)
  at hudson.remoting.UserRequest.perform(UserRequest.java:48)
  at hudson.remoting.Request$2.run(Request.java:328)
  at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)
  at java.util.concurrent.FutureTask.run(FutureTask.java:266)
  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
  at hudson.remoting.Engine$1$1.run(Engine.java:63)
  at java.lang.Thread.run(Thread.java:744)
Caused by: java.io.IOException: error=2, No such file or directory
  at java.lang.UNIXProcess.forkAndExec(Native Method)
  at java.lang.UNIXProcess.<init>(UNIXProcess.java:185)
  at java.lang.ProcessImpl.start(ProcessImpl.java:134)
  at java.lang.ProcessBuilder.start(ProcessBuilder.java:1023)
  ... 15 more
Build step 'Invoke Ant' marked build as failure
Archiving artifacts
Finished: FAILURE

编辑:我正在使用“调用ANT”。在Windows从站中,相同的设置工作正常。


阅读 415

收藏
2020-07-25

共1个答案

小编典典

好的,这就是我要做的。

即使在确保正确设置PATH,ANT_HOME之后,我也无法使我的默认ANT与Jenkins一起使用。我想使用“调用蚂蚁”。但是,“执行外壳”方法会在从属计算机中成功调用默认的Ant。

然后,我不得不使用Jenkins中的“自动安装”选项来下载Ant并将其安装在MAC从站中以运行目标。现在工作正常。

尽管我的问题已解决,但我仍然很好奇为什么默认值不能与“ Invoke Ant”选项一起使用。大家都知道,请澄清。

谢谢你们。

2020-07-25