我想在 Hudson 开始工作以构建我的 netbeans Web 项目。虽然我可以ant dist
在我的项目目录中成功运行,但我的 hudson 任务在其自己的工作区中更新(拉取)数据后引发以下错误
-init-debug-args:
BUILD FAILED
C:\Windows\System32\config\systemprofile\.hudson\jobs\Scribe\workspace\nbproject\build-impl.xml:485: Execute failed: java.io.IOException: Cannot run program "${platforms.JDK_1.6_64_Bit_.home}\bin\java": CreateProcess error=2, The system cannot find the file specified
at java.lang.ProcessBuilder.start(ProcessBuilder.java:460)
at java.lang.Runtime.exec(Runtime.java:593)
at org.apache.tools.ant.taskdefs.Execute$Java13CommandLauncher.exec(Execute.java:862)
at org.apache.tools.ant.taskdefs.Execute.launch(Execute.java:481)
at org.apache.tools.ant.taskdefs.Execute.execute(Execute.java:495)
at org.apache.tools.ant.taskdefs.ExecTask.runExecute(ExecTask.java:631)
at org.apache.tools.ant.taskdefs.ExecTask.runExec(ExecTask.java:672)
at org.apache.tools.ant.taskdefs.ExecTask.execute(ExecTask.java:498)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.Target.execute(Target.java:390)
at org.apache.tools.ant.Target.performTasks(Target.java:411)
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1399)
at org.apache.tools.ant.Project.executeTarget(Project.java:1368)
at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
at org.apache.tools.ant.Project.executeTargets(Project.java:1251)
at org.apache.tools.ant.Main.runBuild(Main.java:809)
at org.apache.tools.ant.Main.startAnt(Main.java:217)
at org.apache.tools.ant.launch.Launcher.run(Launcher.java:280)
at org.apache.tools.ant.launch.Launcher.main(Launcher.java:109)
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>(ProcessImpl.java:81)
at java.lang.ProcessImpl.start(ProcessImpl.java:30)
at java.lang.ProcessBuilder.start(ProcessBuilder.java:453)
... 23 more
Total time: 0 seconds
[DEBUG] Skipping watched dependency update for build: Scribe #12 due to result: FAILURE
Finished: FAILURE
我在哈德森的构建命令如下所示
set PATH=%PATH%;C:\Program Files\Java\jrockit-jdk1.6.0_29-R28.2.2-4.1.0\bin
set JAVA_HOME=C:\Program Files\Java\jrockit-jdk1.6.0_29-R28.2.2-4.1.0
I:\Developement\libs\apache-ant-1.8.2\bin\ant -Dj2ee.server.home=E:\eClinicalWorks\tomcat6 dist
令人惊讶ant
的是不能从“PATH”变量中识别出来,而是我必须给出绝对路径
build-impl.xml 可以在这里找到http://cynosuredev.com/build-impl.xml