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

[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

当前回答

我的决心是将Jenkinsfile中提到的超时时间从90更改为120。

pipeline {
    agent { label projectName }

options {
    disableConcurrentBuilds()
    buildDiscarder(logRotator(numToKeepStr:'5'))
    timeout(time: 90, unit: 'MINUTES')
}

谢谢 南非

其他回答

在Windows (OpenJDK11, Maven 3.6.0, SUREFIRE 3.0.0-M1)上,我得到了根本原因:

# Created at 2018-11-14T14:28:15.629
OpenJDK 64-Bit Server VM warning: INFO: os::commit_memory(0x00000006c7500000, 522190848, 0) failed; error='The paging file is too small for this operation to complete' (DOS error/errno=1455)

并通过增加分页文件大小来解决,例如这样。

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

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

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

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

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

您可以设置java选项

SET JAVA_OPTS='-Xmx1024m' XX:+UseLoopPredicate

MVN清洁安装

我在升级到java 12后遇到了类似的问题,对我来说,解决方案是更新jacoco版本<jacoco.version>0.8.3</jacoco.version>

以上都试过了,都没用。下面的解决方案适合我:

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.19.1</version>
<configuration>
    <argLine>-Dfile.encoding=UTF-8</argLine>
</configuration>