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

[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-surefile-plugin的useSystemClassLoader应该会有帮助

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-surefire-plugin</artifactId>
    <version>2.22.0</version>
    <configuration>
        <useSystemClassLoader>false</useSystemClassLoader>
    </configuration>
</plugin>

其他回答

添加配置文件后,我可以删除这个错误:

<profile>
            <id>surefire-windows-fork-disable</id>
            <activation>
                <os>
                    <family>Windows</family>
                </os>
            </activation>
            <build>
                <pluginManagement>
                    <plugins>
                        <plugin>
                            <groupId>org.apache.maven.plugins</groupId>
                            <artifactId>maven-surefire-plugin</artifactId>
                            <configuration>
                                <forkCount>0</forkCount>
                                <useSystemClassLoader>false</useSystemClassLoader>
                            </configuration>
                        </plugin>
                    </plugins>
                </pluginManagement>
            </build>
        </profile>

似乎这是一个关于maven的问题

截至今天(2018年10月30日),我们注意到我们的构建在Jenkins中出现了这个错误。

这个错误有点误导人,需要查看target/surefire-reports/中转储的输出,才能看到以下错误消息:

Error: Could not find or load main class org.apache.maven.surefire.booter.ForkedBooter

这让我想到了下面的SO帖子,其中提到了OpenJDK 181中一个可能的错误:Maven surefire无法找到ForkedBooter类

那篇文章中的任何一个修复都解决了我的问题。具体来说,我使用了其中之一:

从docker容器maven:3.5.4-jdk-8中的构建切换到maven:3.5.4-jdk-8-alpine 重写Spring Boot的类加载器详细信息请参见:https://stackoverflow.com/a/50661649/1228408

测试中使用的分叉JVM内存不足。 解决方案是禁用分叉JVM并在主JVM上运行测试,以确保有足够的内存,或者通过参数来增加分叉JVM的内存

在这个答案中找出答案

Surefire FAQ的这一部分可以帮助你:

Surefire fails with the message "The forked VM terminated without properly saying goodbye" Surefire does not support tests or any referenced libraries calling System.exit() at any time. If they do so, they are incompatible with surefire and you should probably file an issue with the library/vendor. Alternatively the forked VM could also crash for a number of reasons, which can also make this issue happen. Look for the classical "hs_err*" files indicating VM crashes or examine the log output from running maven when the tests execute. Some "extraordinary" output from crashing processes may be dumped to the console/log. If this happens on a CI environment and only after some time runs there is a fair chance your test suite is leaking some kind of OS-level resource that makes things worse for every run. Regular os-level monitoring tools may give you some indication.

导致:java.util.concurrent.ExecutionException: java.lang.RuntimeException:分叉虚拟机未正确告别而终止。虚拟机崩溃或系统崩溃。退出叫什么?”

如果使用不兼容的java版本,则可能出现此问题。喜欢使用新版本的java,而代码支持一些其他版本。