Maven Surefire 2.13无法在Windows上分叉 [英] Maven Surefire 2.13 fails to fork on Windows
问题描述
我有一个包含多个测试用例的项目,我使用Maven surefire插件2.13对其进行了编译.当我设置forkmode = none
时,一切正常,但是当我省略该条目时,默认的forkmode
变为once
,而我的项目失败:
I have a project which includes a number of test cases and I compile it using the Maven surefire plugin 2.13. When I set the forkmode = none
everything works fine,but when I omit that entry, the default forkmode
become once
and my project fails:
Forking command line: cmd.exe /X /C ""C:\Program Files\Java\jdk1.6.0_37\jre\bin\java" -jar G:\Gottware-server\core\math\target\surefire\surefirebooter
7758025909061587587.jar G:\Gottware-server\core\math\target\surefire\surefire8735550212668630533tmp G:\Gottware-server\core\math\target\surefire\suref
ire_08386349728753606434tmp"
The system cannot find the path specified.
我正在使用Windows 7,这似乎是操作系统问题.出什么毛病了?很好奇的是,在成功构建之后,我也会遇到相同的错误:
It looks like it's an OS problem, I am using Windows 7. What can be going wrong? IT's curious that also after succesfull builds I get the same error:
[INFO] -----------------------------------------------
[INFO] BUILD SUCCESS
[INFO] -----------------------------------------------
[INFO] Total time: 15.504s
[INFO] Finished at: Fri Mar 08 15:08:54 CET 2013
[INFO] Final Memory: 13M/353M
[INFO] -----------------------------------------------
The system cannot find the path specified.
事实上,我已经调试了mvn.bat的Maven的最后一行
In fact I have debugged my last line of my maven of the mvn.bat
cmd /C exit /B %ERROR_CODE%
而且返回以下内容根本不起作用:
and this simply does not work anymore returning:
The system cannot find the path specified.
我进一步调试时失败了
U:\>cmd.exe
Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.
The system cannot find the path specified.
推荐答案
在您粘贴的行中,我看到一个双引号:
In the line you pasted, I see a doubled double-quote:
Forking command line: cmd.exe /X /C ""C:\Program
^^^^
也许您为JAVA_HOME(或在其他定义Java路径的地方)设置了错误的值.这也可以解释为什么它在其他系统上不会失败:您在那里有一个不同的(并且正确的)JAVA_HOME.
Maybe you've set a bad value for JAVA_HOME (or some other place where you've defined the Java path). This would also explain why it doesn't fail on other systems: you've got a different (and correct) JAVA_HOME there.
这篇关于Maven Surefire 2.13无法在Windows上分叉的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!