windows - Windows 上的 Hudson - 错误 : java. io.IOException:无法运行程序 "sh"

标签 windows jenkins continuous-integration hudson

我正在尝试与 Hudson 和 MSTest 进行持续集成。

当我尝试运行此作业时,出现以下错误:

1 Warnung(en)
    0 Fehler

Verstrichene Zeit 00:00:00.13
[workspace] $ sh -xe C:\Windows\TEMP\hudson4419897732634199534.sh
The system cannot find the file specified
FATAL: Befehlsausführung fehlgeschlagen
java.io.IOException: Cannot run program "sh" (in directory "C:\Users\Markus\.hudson\jobs\Test1 Unit TEst\workspace"): CreateProcess error=2, Das System kann die angegebene Datei nicht finden
    at java.lang.ProcessBuilder.start(Unknown Source)
    at hudson.Proc$LocalProc.<init>(Proc.java:187)
    at hudson.Proc$LocalProc.<init>(Proc.java:157)
    at hudson.Launcher$LocalLauncher.launch(Launcher.java:649)
    at hudson.Launcher$ProcStarter.start(Launcher.java:266)
    at hudson.Launcher$ProcStarter.join(Launcher.java:273)
    at hudson.tasks.CommandInterpreter.perform(CommandInterpreter.java:79)
    at hudson.tasks.CommandInterpreter.perform(CommandInterpreter.java:54)
    at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:34)
    at hudson.model.AbstractBuild$AbstractRunner.perform(AbstractBuild.java:646)
    at hudson.model.Build$RunnerImpl.build(Build.java:181)
    at hudson.model.Build$RunnerImpl.doRun(Build.java:136)
    at hudson.model.AbstractBuild$AbstractRunner.run(AbstractBuild.java:434)
    at hudson.model.Run.run(Run.java:1390)
    at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:40)
    at hudson.model.ResourceController.execute(ResourceController.java:81)
    at hudson.model.Executor.run(Executor.java:137)
Caused by: java.io.IOException: CreateProcess error=2, Das System kann die angegebene Datei nicht finden
    at java.lang.ProcessImpl.create(Native Method)
    at java.lang.ProcessImpl.<init>(Unknown Source)
    at java.lang.ProcessImpl.start(Unknown Source)
    ... 17 more
Processing tests results in file results.trx
FATAL: No MSTest TRX test report files were found. Configuration error?
[DEBUG] Skipping watched dependency update for build: Test1 Unit TEst #5 due to result: FAILURE
Finished: FAILURE

我的配置如下所示:

Buildverfahren
Build a Visual Studio project or solution using MSBuild
    MSBuild Version MS Build .NET 4 
    MSBuild Build File  trunk\UnitTestWithNHibernate\UnitTestWithNHibernate.sln 
    Command Line Arguments  /p:Configuration=Release

我的命令行是这样的:

"C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\MSTest.exe"
/runconfig: trunk\UnitTestWithNHibernate\UnitTest\LocalTestRun.testrunconfig  /testcontainer: trunk\UnitTestWithNHibernate\UnitTest\bin\Debug\UnitTest.dll /resultsfile:results.trx

最佳答案

如果您将 Windows 命令指定为“执行 shell”而不是“执行 Windows 批处理命令”,则会发生这种情况。

关于windows - Windows 上的 Hudson - 错误 : java. io.IOException:无法运行程序 "sh",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15135771/

相关文章:

jenkins - 在 Jenkinsfile 中结帐 scm

jenkins - 从 Jenkins 管道执行脚本

git - 让 buildbot 轮询 git 存储库以获取新提交?

continuous-integration - 如何: Teamcity + GitHub

java - 为什么我不能在java中更改所需文件的文件扩展名?

windows - Windows 中的 Hadoop : file not found exception

windows - Docker Toolbox Windows登录quay.io

java - Hudson/Jenkins vs Cruise Control vs Luntbuild vs Continuum

linux - 双启动Windows 7和CentOS 7,Windows 7 BOOTMGR丢失

git - 向 Jenkins 管道中的上游提交者发送通知电子邮件