在进行maven构建时,我收到以下错误。 有人知道怎么解决吗?
线程中的异常" main"线程中的异常"线程-1"线程中的异常"线程-7"线程中的异常"线程-3"线程中的例外"线程-4"线程中的异常"线程-2"线程中的异常"线程-5"异常:java.lang.OutOfMemoryError从线程" main"中的UncaughtExceptionHandler抛出 例外:从线程"线程-1"中的UncaughtExceptionHandler抛出的java.lang.OutOfMemoryError 例外:从线程"线程-7"中的UncaughtExceptionHandler抛出java.lang.OutOfMemoryError。 例外:从线程"线程-3"中的UncaughtExceptionHandler抛出的java.lang.OutOfMemoryError 例外:从线程"线程-4"中的UncaughtExceptionHandler抛出的java.lang.OutOfMemoryError 例外:从线程"线程-2"中的UncaughtExceptionHandler抛出的java.lang.OutOfMemoryError 例外:从线程"线程-5"
中的UncaughtExceptionHandler抛出java.lang.OutOfMemoryError Results :
Tests run: 100, Failures: 0, Errors: 0, Skipped: 0
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ---------------------------------------------------------------------
[INFO] Total time: 01:14 min
[INFO] Finished at: 2018-02-11T00:12:46+01:00
[INFO] Final Memory: 87M/704M
[INFO] ---------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.19.1:test (default-test) on project coba.zaa.engine.workflow: Execution default-test of goal org.apache.maven.plugins:maven-surefire-plugin:2.19.1:test failed: The forked VM terminated without properly saying goodbye. VM crash or System.exit called?
[ERROR] Command was cmd.exe /X /C "C:\xxxxx\Tools\Release2\JDK\jdk_1.7.0.80_x64\jre\bin\java -jar C:\vvv\ZAA\nnnn\mmmmmm\target\surefire\surefirebooter1494547892126715647.jar C:\vvv\ZAA\nnnn\mmmmmm\\target\surefire\surefire2662483945733244110tmp C:\vvv\ZAA\nnnn\mmmmmm\target\surefire\surefire_05005140060060096785tmp"
[ERROR] -> [Help 1]
[ERROR]
http://cwiki.apache.org/confluence/display/MAVEN/PluginExecutionException
答案 0 :(得分:1)
听起来像surefire插件分支的JVM中的内存设置。这些不是从主MAVEN_OPTS继承的,所以需要直接在pom.xml中设置:
<build>
<plugins>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<argLine>-Xmx2g</argLine>
</configuration>
</plugin>
</plugins>
</build>