Thursday, 15 April 2010

Jenkins build error - Cannot run program "ant" -



Jenkins build error - Cannot run program "ant" -

i have build.xml set run project execute selenium test cases. have mac computer , can run ant terminal. when seek run jenkins next error. have specified ant home in jenkins' config

/usr/local/cellar/ant/1.9.4/libexec

i used homebrew install ant fatal: command execution failed.maybe need configure job take 1 of ant installations? java.io.ioexception: cannot run programme "ant" (in directory "/users/shared/jenkins/home/workspace/baublebartest"): error=2, no such file or directory @ java.lang.processbuilder.processexception(processbuilder.java:478) @ java.lang.processbuilder.start(processbuilder.java:457) @ hudson.proc$localproc.<init>(proc.java:244) @ hudson.proc$localproc.<init>(proc.java:216) @ hudson.launcher$locallauncher.launch(launcher.java:802) @ hudson.launcher$procstarter.start(launcher.java:380) @ hudson.launcher$procstarter.join(launcher.java:387) @ hudson.tasks.ant.perform(ant.java:217) @ hudson.tasks.buildstepmonitor$1.perform(buildstepmonitor.java:20) @ hudson.model.abstractbuild$abstractbuildexecution.perform(abstractbuild.java:770) @ hudson.model.build$buildexecution.build(build.java:199) @ hudson.model.build$buildexecution.dorun(build.java:160) @ hudson.model.abstractbuild$abstractbuildexecution.run(abstractbuild.java:533) @ hudson.model.run.execute(run.java:1754) @ hudson.model.freestylebuild.run(freestylebuild.java:43) @ hudson.model.resourcecontroller.execute(resourcecontroller.java:89) @ hudson.model.executor.run(executor.java:240) caused by: java.io.ioexception: error=2, no such file or directory @ java.lang.unixprocess.enter code hereforkandexec(native method) @ java.lang.unixprocess.<init>(unixprocess.java:53) @ java.lang.processimpl.start(processimpl.java:91) @ java.lang.processbuilder.start(processbuilder.java:452) ... 15 more build step 'invoke ant' marked build failure finished: failure

first, proper way

jenkins install ant (and other tools you). on global configuration (manage jenkins), configure ant installation, selecting version , source.

then, when run ant build step, can take version, either default or 1 you've configured. when build executed, jenkins download, install, , configure particular version (within jenkins only), without affecting rest of os. installation needs happen 1 time per node, , after it's quick.

the default

that default version fallback jenkins uses when you haven't configured proper version use. tries utilize whatever available on command line, executing ant current working directory.

you said works when type ant on command line, you've got realize jenkins runs under jenkins user, not logged in user, , things ant_home , proper path ant configured user.

so prepare issue, either utilize proper way jenkins doing tool installation, or configure tool on os level jenkins user.

you can start typing: sudo su jenkins ant , seeing if works within jenkins user

ant jenkins

No comments:

Post a Comment