开发者

Hudson detects a successful Ant build as a failure

开发者 https://www.devze.com 2023-02-14 11:08 出处:网络
My Hudson version is 1.249 (old, I know).Java version is 1.6.0_17.Ant version is 1.6.5.Here\'s the Console Output from Hudson:

My Hudson version is 1.249 (old, I know). Java version is 1.6.0_17. Ant version is 1.6.5. Here's the Console Output from Hudson:

started
[workspace] $ "C:\Progs\GNU\WinCvs 1.3\cvs.exe" -q -z3 update -PdC -D "Thursday, February 10, 2011 8:56:43 AM UTC"
? bin
? pdfer.jar
P src/main/java/com/xxxxx/pdfer/Job.java
P src/main/java/com/xxxxx/pdfer/Manager.java
U src/main/java/com/xxxxx/pdfer/ManagerException.java
P src/main/java/com开发者_C百科/xxxxx/pdfer/Queue.java
U src/main/java/com/xxxxx/pdfer/QueueException.java
P src/main/java/com/xxxxx/pdfer/ResultHandler.java
U src/main/java/com/xxxxx/pdfer/ResultHandlerException.java
P src/test/java/com/xxxxx/pdfer/JobTest.java
P src/test/java/com/xxxxx/pdfer/ManagerTest.java
$ computing changelog
[workspace] $ cmd.exe /C '"ant.bat && exit %%ERRORLEVEL%%"'
Buildfile: build.xml

build:
   [delete] Deleting directory C:\hudson\jobs\XXX-PDFer-PDFer\workspace\bin
    [mkdir] Created dir: C:\hudson\jobs\XXX-PDFer-PDFer\workspace\bin
    [javac] Compiling 11 source files to C:\hudson\jobs\XXX-PDFer-PDFer\workspace\bin
      [jar] Building jar: C:\hudson\jobs\XXX-PDFer-PDFer\workspace\pdfer.jar

BUILD SUCCESSFUL
Total time: 2 seconds
finished: FAILURE


Is the job set to do anything else after the build completion? It could be that the failure message is related to the hudson job while the success relates to the ant build step. It's possible there are other steps after the build, which are failing. If i were you I'd look at the project configuration page to confirm.


Hudson/Jenkins looks at the exit status of the last command in the job. If you have other steps after ant, such as cleaning up temporary files, uninstalling, etc, you need to save the status of the build before doing that, then as your last step make sure you exit appropriately.

For example, for some of our jobs we have a final "summary" python script that greps the logs and exits with an appropriate exit code if there were failures in the build or test scripts. Running this as the very last step insures hudson reports the proper status, plus it lets us print a nice concise summary at the end of the job.


Something to do with the exit status returned by Ant in the version I was using (6) as reported by another user here. I "solved" it by upgrading to version 8.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号