0

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
3
  • 2
    If you added task correctly as "Execute Windows batch command" then it looks like problem with your Windows. Can you check c:\Windows\system32\cmd.exe exists (or change it according your system path)? And also check if path is added to system path. Commented Jul 5, 2013 at 11:17
  • I'm curious why you can't change the build to use an additional build step. Your existing solution is likely to become more complex to a point of inviability long term. Commented Jul 8, 2013 at 17:14
  • Did you change your PATH environment variable, e.g. by using a build parameter with the same name? Commented Jul 8, 2013 at 21:36

2 Answers 2

1

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.
Sign up to request clarification or add additional context in comments.

Comments

0

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

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.