Windows批处理命令上的jenkins错误

时间:2013-07-05 11:06:55

标签: windows jenkins

PLS。帮助,我通过Windows批处理命令构建作业卡住运行测试,

我有一只这样的蝙蝠:

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

在hudson中执行此操作时,我的构建成功但我收到此错误并失败,

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

2 个答案:

答案 0 :(得分:1)

不要使用bat构建步骤来调用maven,你会对maven构建步骤更开心。我认为构建步骤被列为“调用顶级maven项目”这将为您提供一些额外的特殊酱油

  • 您将能够选择为此特定版本运行哪个版本的maven(如果不存在,甚至可以将其安装在奴隶上)。
  • 您可以使用文本框填写pom,属性,jvm选项和mvn设置文件,而不是构建命令行。
  • 您可以指定一个不同的本地mvn存储库(~/.m2/repository除了我经常执行此操作,因此它将.m2目录放在工作区中。这会占用更多的磁盘空间,但可以从中获取。如果您正在清理工作空间,那么您将花费相当多的时间 - 特别是如果您没有在工件管理器中缓存工件。

答案 1 :(得分:0)

我也碰到了这个。我在系统配置中错误地设置了PATH,一旦修好了,错误就消失了。