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

[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

当前回答

我尝试了所有提供的解决方案(分叉,系统加载器,更多的内存等),没有工作。

环境:在gitlab ci环境中构建失败,在docker容器中运行构建。

解决方案: 我们在2.20.1版本中使用surefireplugin,升级到2.21.0或更高版本(我们使用2.22.1)修复了这个问题。

原因: surefire -1422 - surefire使用ps命令,该命令在docker环境中不可用,导致“崩溃”。此问题在2.21.0或更高版本中修复。

感谢另一个问题的答案:https://stackoverflow.com/a/50568662/2970422

其他回答

当我试图在运行JAVA = 1.8的windows 10环境上编译一个设置为1.7的maven项目时,确实遇到了同样的问题。

我通过将java版本从1.7更改为1.8来解决这个问题,如下所示。

 <plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-compiler-plugin</artifactId>
    <version>3.3</version>
    <configuration>
      <source>1.8</source>
      <target>1.8</target>
    </configuration>
  </plugin>

我尝试了所有提供的解决方案(分叉,系统加载器,更多的内存等),没有工作。

环境:在gitlab ci环境中构建失败,在docker容器中运行构建。

解决方案: 我们在2.20.1版本中使用surefireplugin,升级到2.21.0或更高版本(我们使用2.22.1)修复了这个问题。

原因: surefire -1422 - surefire使用ps命令,该命令在docker环境中不可用,导致“崩溃”。此问题在2.21.0或更高版本中修复。

感谢另一个问题的答案:https://stackoverflow.com/a/50568662/2970422

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

在这个答案中找出答案

我遇到过一个案例,其中没有一个答案能解决问题。它是一个遗留应用程序,恰好使用log4j和SLF4J/logback。

前面的情况:干净的测试构建在Eclipse中启动时运行良好,但是在命令行中启动时,出现了这个错误。基于CircleCI的CI构建也运行良好。

我所做的是:出于纯粹的猜测,配置一个适当的logback-test.xml并降低日志记录的冗长程度。你瞧,我再也没有遇到过这个错误,我现在可以从命令行构建项目(以及发生这个错误的模块)。

我的观点是,日志框架的使用或配置方式可能是另一种解释。

log4j和logback之间真的有冲突吗?或者仅仅是测试产生的大量日志以某种方式溢出了命令行缓冲区?我不知道。这对我来说仍然是个谜。

可能是因为你在你的项目中应用了一些更改,没有更新他们所有的引用。

在我的情况下,我得到这个错误,因为我已经更新了包的名称在我的项目,但我忘记更新他们的引用在TestNG.xml文件。通过修正,我解决了这个错误。