Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ant with Hudson

Tags:

java

svn

hudson

ant

I have problem in running the Job in Hudson. I have configured the Hudson with the ANT_HOME with the path of the ant and JDK as well with the relative path. And I created a New Job, where I setup the SVN path and rest of the things. My build.xml of the project is in Project root Folder/build/build.xml

And them I have added the build.xml in the Linux. Which is like this.

<project name="Test Job" default="build">
    <target name="clean">
        <delete dir="${basedir}/svn/_build"/>
        <delete dir="${basedir}/build"/>
    </target>
    <target name="prepare">
        <mkdir dir="${basedir}/svn/_build/logs"/>
        <mkdir dir="${basedir}/build/logs"/>
        <mkdir dir="${basedir}/build/docs"/>
    </target>
    <target name="build"
            depends="clean,prepare"/>
</project> 

Note : My I set my job name as usercentral.

Then I tried build now on Hudson. It is giving me the below error.

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 "/root/.hudson/jobs/userCentral/workspace/branches/branches/build"): java.io.IOException: error=2, No such file or directory
    at java.lang.ProcessBuilder.start(ProcessBuilder.java:460)
    at hudson.Proc$LocalProc.(Proc.java:192)
    at hudson.Proc$LocalProc.(Proc.java:164)
    at hudson.Launcher$LocalLauncher.launch(Launcher.java:638)
    at hudson.Launcher$ProcStarter.start(Launcher.java:273)
    at hudson.Launcher$ProcStarter.join(Launcher.java:280)
    at hudson.tasks.Ant.perform(Ant.java:216)
    at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:19)
    at hudson.model.AbstractBuild$AbstractRunner.perform(AbstractBuild.java:603)
    at hudson.model.Build$RunnerImpl.build(Build.java:172)
    at hudson.model.Build$RunnerImpl.doRun(Build.java:137)
    at hudson.model.AbstractBuild$AbstractRunner.run(AbstractBuild.java:417)
    at hudson.model.Run.run(Run.java:1362)
    at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
    at hudson.model.ResourceController.execute(ResourceController.java:88)
    at hudson.model.Executor.run(Executor.java:145)
Caused by: java.io.IOException: java.io.IOException: error=2, No such file or directory
    at java.lang.UNIXProcess.(UNIXProcess.java:148)
    at java.lang.ProcessImpl.start(ProcessImpl.java:65)
    at java.lang.ProcessBuilder.start(ProcessBuilder.java:453)
    ... 15 more
Finished: FAILURE

Can any one please help me.

like image 265
Kumar Avatar asked Feb 23 '11 14:02

Kumar


People also ask

Are Renee Zellweger and Ant still together?

Renée Zellweger and Ant Anstead might have seemed like an unlikely match when they were first linked, but the two are still going strong over a year later. The couple first met while filming Anstead's Discovery+ show Celebrity IOU Joyride. Soon after, PEOPLE confirmed Zellweger and Anstead were dating in June 2021.

What did ant say about Christina?

According to his declaration in the court documents, Ant Anstead, 43, felt that Hall was using their son for her "personal gain." The Wheeler Dealers co-host highlighted the problems after being exposed to TV production and how such things affect children's personalities.

What is Ant Anstead doing in 2022?

Ant Anstead's plans for the show - Classic Car & Restoration Show 2022.


2 Answers

Append $ANT_HOME/bin to your existing PATH in order for Hudson to be able to look for the ant command... or at least, that's how I fixed my same exact problem.

like image 76
limc Avatar answered Oct 20 '22 02:10

limc


Give hudson the absolute path to your ant installation. You can do this in the configs. Then just use this ant installation in your builds. You won't have to give an ANT_HOME.

like image 3
Daniel Avatar answered Oct 20 '22 01:10

Daniel