简体   繁体   中英

jenkins error on windows batch command

Pls. help, I am stuck running tests through windows batch command build job ,

I have a bat like this :

cd SkySuperplanner
mvn clean install test -Dtest=ExecuteAllSuite -DfailIfNoTests=false

on executing this in hudson , my build is sucessful but I get this error and fails ,

Started by user anonymous
Building in workspace C:\Program Files\Jenkins\workspace\Sky+iPad-Seetest-Smoke
[Sky+iPad-Seetest-Smoke] $ cmd /c call C:\Windows\TEMP\hudson1804953959577254996.bat

C:\Program Files\Jenkins\workspace\Sky+iPad-Seetest-Smoke>AlltestBuild.bat

C:\Program Files\Jenkins\workspace\Sky+iPad-Seetest-Smoke>cd SkySuperplanner 

C:\Program Files\Jenkins\workspace\Sky+iPad-Seetest-Smoke\SkySuperplanner>mvn clean install test -Dtest=ExecuteAllSuite -DfailIfNoTests=false 

[INFO] Scanning for projects...
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building SkySuperplanner 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] --- maven-clean-plugin:2.4.1:clean (default-clean) @ SkySuperplanner ---
[INFO] Deleting C:\Program Files\Jenkins\workspace\Sky+iPad-Seetest-Smoke\SkySuperplanner\target

-------------------------------------------------------
---------------------------------blah blah balh
-----------------------


[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 19.515s
[INFO] Finished at: Fri Jul 05 11:50:46 BST 2013
[INFO] Final Memory: 10M/26M
[INFO] ------------------------------------------------------------------------
'cmd' is not recognized as an internal or external command,
operable program or batch file.
Build step 'Execute Windows batch command' marked build as failure
Recording test results
Finished: FAILURE

Don't use a bat build step to invoke maven, you'll be happier with a maven build step. I think the build step is listed as 'invoke top level maven project' This is going to give you some added special sauce

  • you'll be able to select which version of maven to run on for this particular build (even installing it on the slave if not present).
  • Rather than building a commandline, you'll have text boxes to fill in for your pom, properties, jvm options and mvn settings files.
  • You can specify a different local mvn repository (other than ~/.m2/repository I often do this so it puts the .m2 directory in the workspace. This takes more disk space, but frees one from getting the .m2 dir full of years of cruft. If you're cleaning the workspace you're going to spend quite a bit more time - especially if you aren't caching artifacts in an artifact manager.

I ran into this too. I had set PATH in the system configuration incorrectly, once I fixed that, the error went away.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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