简体   繁体   English

蚂蚁与哈德森

[英]Ant with Hudson

I have problem in running the Job in Hudson. 我在Hudson中运行Job时遇到问题。 I have configured the Hudson with the ANT_HOME with the path of the ant and JDK as well with the relative path. 我已经使用ANT_HOME配置了Hudson,其中包含ant和JDK的路径以及相对路径。 And I created a New Job, where I setup the SVN path and rest of the things. 我创建了一个新工作,在那里我设置了SVN路径和其他东西。 My build.xml of the project is in Project root Folder/build/build.xml 我的项目的build.xml位于Project root Folder / build / build.xml中

And them I have added the build.xml in the Linux. 他们在Linux中添加了build.xml。 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. 注意:我将我的工作名称设置为usercentral。

Then I tried build now on Hudson. 然后我尝试在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. 谁能帮帮我吗。

$ANT_HOME/bin附加到现有PATH ,以便Hudson能够查找ant命令...或者至少,这就是我修复同样问题的方法。

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. 然后在您的构建中使用此ant安装。 You won't have to give an ANT_HOME. 你不必给ANT_HOME。

First, I told Hudson to use some version of Ant that it automatically installed and give that version of Ant a name. 首先,我告诉Hudson使用它自动安装的某个版本的Ant,并为该版本的Ant命名。 (From the Ant part of the Manage Hudson->Configure System page) (来自Manage Hudson-> Configure System页面的Ant部分)

Second, I told the new project which named Ant to use. 其次,我告诉使用Ant的新项目。 (From the Invoke Ant part of the project configuration" (从项目配置的Invoke Ant部分“

Sounds like it could be a permissions issue. 听起来这可能是一个权限问题。 Does the hudson user have access to the directory path for all the relevant files and directories? 哈德森用户是否可以访问所有相关文件和目录的目录路径?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM