在我的两个Windows从站之一上安装ant-1.10 x失败

时间:2019-04-10 17:49:03

标签: windows jenkins ant mercurial hudson

我正在使用Jenkins 1.620运行开发和测试作业的开发环境中。

我们正在使用Ant插件1.5和Mercurial插件1.54分别与Ant和Mercurial集成:

enter image description here

enter image description here

在我们的一项构建工作中,我正在尝试运行ant-1.10 x:

enter image description here

这在我们的Linux从站上可以正常工作:

[28ed6df2] $ /usr/bin/hg log --template "<changeset node='{node}' author='{author|xmlescape}' rev='{rev}' date='{date}'><msg>{desc|xmlescape}</msg><added>{file_adds|stringify|xmlescape}</added><deleted>{file_dels|stringify|xmlescape}</deleted><files>{files|stringify|xmlescape}</files><parents>{parents}</parents></changeset>\n" --rev "ancestors('349ba3fc4e01c8a12fcfbe8d69c3e23913c5122f') and not ancestors(cadec7ae4013241d45a0ca048c801ad55d751604)" --encoding UTF-8 --encodingmode replace
[ant-1.10.x] $ sh -e /home/release/jenkins-slave/tools/hudson.tasks.Ant_AntInstallation/ant-1.10.x/hudson1700384793561784219.sh
pulling from https://elmo.luciad.com/hg/tools/devscripts/
searching for changes
no changes found
0 files updated, 0 files merged, 0 files removed, 0 files unresolved
[28ed6df2] $ /home/release/jenkins-slave/tools/hudson.tasks.Ant_AntInstallation/ant-1.10.x/devscripts/ant/apache-ant-1.10.x/bin/ant -Djdk=8u121 -Dlabel_exp=linux&&chrome&&firefox&&nodejs -Dria.testconfig=common/test/responsibilities/milsym clean test
Buildfile: /home/release/jenkins-slave/workspace/LuciadRIA - 2017.1 - TEST - MilSym/28ed6df2/build.xml

它可以在我们的Windows奴隶之一上正常工作:

[ab4857c1] $ "C:\Program Files\TortoiseHg/hg" log --template "<changeset node='{node}' author='{author|xmlescape}' rev='{rev}' date='{date}'><msg>{desc|xmlescape}</msg><added>{file_adds|stringify|xmlescape}</added><deleted>{file_dels|stringify|xmlescape}</deleted><files>{files|stringify|xmlescape}</files><parents>{parents}</parents></changeset>\n" --rev "ancestors('cadec7ae4013241d45a0ca048c801ad55d751604') and not ancestors(20171294f31b5a54c90d7a7ca843d54af5235fdb)" --encoding UTF-8 --encodingmode replace
[ant-1.10.x] $ cmd /c call C:\Users\release\jenkins-slave\tools\hudson.tasks.Ant_AntInstallation\ant-1.10.x\hudson3353656856975714646.bat

C:\Users\release\jenkins-slave\tools\hudson.tasks.Ant_AntInstallation\ant-1.10.x>IF EXIST devscripts (hg -R devscripts pull )  ELSE (hg clone -U "https://elmo.luciad.com/hg/tools/devscripts/" ) 
pulling from https://elmo.luciad.com/hg/tools/devscripts/
searching for changes
no changes found

C:\Users\release\jenkins-slave\tools\hudson.tasks.Ant_AntInstallation\ant-1.10.x>hg -R devscripts up -C default 
0 files updated, 0 files merged, 0 files removed, 0 files unresolved
[ab4857c1] $ cmd.exe /C '"C:\Users\release\jenkins-slave\tools\hudson.tasks.Ant_AntInstallation\ant-1.10.x\devscripts\ant\apache-ant-1.10.x\bin\ant.bat -Djdk=8u121 "-Dlabel_exp=windows10&&chrome&&firefox&&edge&&ie11&&nodejs" -Dria.testconfig=common/test/responsibilities/milsym clean test && exit %%ERRORLEVEL%%"'
Buildfile: C:\Users\release\jenkins-slave\workspace\LuciadRIA - 2017.1 - TEST - MilSym\ab4857c1\build.xml

但是,在我们的另一个Windows从站上,它失败了:

[ab4857c1] $ "C:\Program Files\TortoiseHg/hg" log --template "<changeset node='{node}' author='{author|xmlescape}' rev='{rev}' date='{date}'><msg>{desc|xmlescape}</msg><added>{file_adds|stringify|xmlescape}</added><deleted>{file_dels|stringify|xmlescape}</deleted><files>{files|stringify|xmlescape}</files><parents>{parents}</parents></changeset>\n" --rev "ancestors('cadec7ae4013241d45a0ca048c801ad55d751604') and not ancestors(20171294f31b5a54c90d7a7ca843d54af5235fdb)" --encoding UTF-8 --encodingmode replace
[ant-1.10.x] $ sh -e C:\Users\jslegers\jenkins-slave\tools\hudson.tasks.Ant_AntInstallation\ant-1.10.x\hudson6544351975704303707.sh
The system cannot find the file specified
FATAL: Cannot run program "sh" (in directory "C:\Users\jslegers\jenkins-slave\tools\hudson.tasks.Ant_AntInstallation\ant-1.10.x"): CreateProcess error=2, The system cannot find the file specified
java.io.IOException: Cannot run program "sh" (in directory "C:\Users\jslegers\jenkins-slave\tools\hudson.tasks.Ant_AntInstallation\ant-1.10.x"): CreateProcess error=2, The system cannot find the file specified
    at java.lang.ProcessBuilder.start(Unknown Source)
    at hudson.Proc$LocalProc.<init>(Proc.java:244)
    at hudson.Proc$LocalProc.<init>(Proc.java:216)
    at hudson.Launcher$LocalLauncher.launch(Launcher.java:816)
    at hudson.Launcher$ProcStarter.start(Launcher.java:382)
    at hudson.Launcher$RemoteLaunchCallable.call(Launcher.java:1149)
    at hudson.Launcher$RemoteLaunchCallable.call(Launcher.java:1114)
    at hudson.remoting.UserRequest.perform(UserRequest.java:121)
    at hudson.remoting.UserRequest.perform(UserRequest.java:49)
    at hudson.remoting.Request$2.run(Request.java:325)
    at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:68)
    at java.util.concurrent.FutureTask.run(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    at hudson.remoting.Engine$1$1.run(Engine.java:69)
    at java.lang.Thread.run(Unknown Source)
    at ......remote call to dover(Native Method)
    at hudson.remoting.Channel.attachCallSiteStackTrace(Channel.java:1361)
    at hudson.remoting.UserResponse.retrieve(UserRequest.java:221)
    at hudson.remoting.Channel.call(Channel.java:753)
    at hudson.Launcher$RemoteLauncher.launch(Launcher.java:929)
    at hudson.Launcher$ProcStarter.start(Launcher.java:382)
    at hudson.Launcher$ProcStarter.join(Launcher.java:389)
    at hudson.tools.AbstractCommandInstaller.performInstallation(AbstractCommandInstaller.java:77)
    at hudson.tools.InstallerTranslator.getToolHome(InstallerTranslator.java:68)
    at hudson.tools.ToolLocationNodeProperty.getToolHome(ToolLocationNodeProperty.java:108)
    at hudson.tools.ToolInstallation.translateFor(ToolInstallation.java:206)
    at hudson.tasks.Ant$AntInstallation.forNode(Ant.java:430)
    at hudson.tasks.Ant.perform(Ant.java:169)
    at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
    at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:779)
    at hudson.model.Build$BuildExecution.build(Build.java:205)
    at hudson.model.Build$BuildExecution.doRun(Build.java:162)
    at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:537)
    at hudson.model.Run.execute(Run.java:1741)
    at hudson.matrix.MatrixRun.run(MatrixRun.java:146)
    at hudson.model.ResourceController.execute(ResourceController.java:98)
    at hudson.model.Executor.run(Executor.java:381)
Caused by: java.io.IOException: CreateProcess error=2, The system cannot find the file specified
    at java.lang.ProcessImpl.create(Native Method)
    at java.lang.ProcessImpl.<init>(Unknown Source)
    at java.lang.ProcessImpl.start(Unknown Source)
    at java.lang.ProcessBuilder.start(Unknown Source)
    at hudson.Proc$LocalProc.<init>(Proc.java:244)
    at hudson.Proc$LocalProc.<init>(Proc.java:216)
    at hudson.Launcher$LocalLauncher.launch(Launcher.java:816)
    at hudson.Launcher$ProcStarter.start(Launcher.java:382)
    at hudson.Launcher$RemoteLaunchCallable.call(Launcher.java:1149)
    at hudson.Launcher$RemoteLaunchCallable.call(Launcher.java:1114)
    at hudson.remoting.UserRequest.perform(UserRequest.java:121)
    at hudson.remoting.UserRequest.perform(UserRequest.java:49)
    at hudson.remoting.Request$2.run(Request.java:325)
    at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:68)
    at java.util.concurrent.FutureTask.run(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    at hudson.remoting.Engine$1$1.run(Engine.java:69)
    at java.lang.Thread.run(Unknown Source)

Jenkins似乎不知道后者是Windows机器,导致它运行sh -e而不是cmd /c

您知道为什么Jenkins无法将其识别为Windows计算机吗?除了安装Cygwin之类的东西以外,您能想到解决此问题的任何方法吗?

1 个答案:

答案 0 :(得分:1)

我的第二个从属具有标签win64windows10,但没有windows

缺少此标签会导致从站无法被识别为Windows计算机。

添加标签可以解决此问题。