请帮我解决这个问题。我不太明白日志中的错误是什么意思。

[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 21.749s
[INFO] Finished at: Thu Apr 24 10:10:20 IST 2014
[INFO] Final Memory: 15M/37M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.15:test (default-test) on project samples.simpleforwarding: Execution default-test of goal org.apache.maven.plugins:maven-surefire-plugin:2.15:test failed: The forked VM terminated without saying properly goodbye. VM crash or System.exit called ?
[ERROR] Command wascmd.exe /X /C ""C:\Program Files\Java\jdk1.7.0_55\jre\bin\java" -Xmx1024m -XX:MaxPermSize=256m -jar E:\OpenDayLight\controller\opendaylight\samples\simpleforwarding\target\surefire\surefirebooter53410321571238933.jar E:\OpenDayLight\controller\opendaylight\samples\simpleforwarding\target\surefire\surefire86076271125218001tmp E:\OpenDayLight\controller\opendaylight\samples\simpleforwarding\target\surefire\surefire_01846991116135903536tmp"
[ERROR] -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginExecutionException

当前回答

在我的情况下,通过设置MAVEN_OPTS增加内存有助于:

set MAVEN_OPTS=-Xmx1024m

其他回答

在JDK 1.8.0_65上使用Jacoco插件运行mvn命令时有类似的问题

[INFO]
A fatal error has been detected by the Java Runtime Environment:

JRE version: Java(TM) SE Runtime Environment (8.0_65-b17) (build 1.8.0_65-b17).........
Problematic frame:
PhaseIdealLoop::build_loop_late_post(Node*)+0x144
............
............
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.19:test (default-test) on project 

 The forked VM terminated without properly saying goodbye. VM crash or System.exit called?

JDK https://bugs.openjdk.java.net/browse/JDK-8081379中有一个bug

解决方案是使用参数-XX:-UseLoopPredicate运行mvn clean install

或者只是对JDK进行更新(我认为更新的小版本也可以)

我遇到了和查德类似的情况,但找到了不同的答案。

根据插件文档,你不能使用${…}在<argLine>中,因为Maven将在surefire插件(或任何其他插件)之前拾取它进行替换。

从2.17版本开始,插件支持@{…}而不是${…}用于属性替换。

举个例子,替换这个

<argLine>XX:MaxPermSize=1024m ${moreArgs}</argLine>

用这个

<argLine>XX:MaxPermSize=1024m @{moreArgs}</argLine>

我使用的文件夹名为test&demo,所以它给出了这个问题(虚拟机没有正确地说再见就终止了。虚拟机崩溃或系统崩溃。退出调用),但当我给文件夹名称为test_demo,然后它解决了这个问题。(有“&”符号的windows操作系统存在此问题。)

将“&”替换为“_”

此问题可能是由文件夹名称中的一些特殊符号或额外空格引起的。

您需要检查您的机器是64位还是32位。如果你的机器是32位的,那么你的内存参数不应该超过4096,即使它应该低于4 GB。 但如果你的机器是64位的,那么安装Java 64位,并在mvn.bat中提供JAVA_HOME,指向Java 64位安装。

发生在我身上的事情:如果你的项目依赖于docker机器或/和数据库来成功构建,那么请首先检查你的db实例是否启动,你的docker也启动,因为可能有一些单元测试在后台运行…特别是在启动笔记本电脑后。希望这能帮助到一些人