【maven】The forked VM terminated without saying properly

97 篇文章 471 订阅 ¥19.90 ¥99.00
本文介绍了在使用Maven时遇到的VM异常终止问题,问题源于单元测试中使用了System.exit(0)导致。解决方案是通过在IDEA中全局搜索并删除此类代码,执行mvn install即可恢复正常。
摘要由CSDN通过智能技术生成

在这里插入图片描述

1.概述

转载:https://blog.csdn.net/zhglance/article/details/53695653

一直在使用Maven开发项目,最近遇到了一个让人头疼的问题,在网上搜索竟然没有找到中文描述的解决方式,自己找了英文网站才明白原因并解决问题,故自己撰写此文,以便同行查阅。

在maven项目中使用maven install命令时,出现The forked VM terminated without saying properly goodbye异常,具体问题如下:

[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 36.927 s
[INFO] Finished at: 2016-12-14T15:13:37+08:00
[INFO] Final Memory: 48M/351M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.19.1:test (default-test) on project message-provider: 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 /bin/sh -c cd /opt/f/.m2/gitlab-runner/builds/0aa902b1/0/paas/message/***-provider && /usr/java/jdk1.8.0_66/jre/bin/java -Xmx1024m -XX:MaxPermSize=256m -jar /opt/f/.m2/gitlab-runner/builds/0aa902b1/0/paas/message/message-provider/target/surefire/surefirebooter780447286825479042.jar /opt/f/.m2/gitlab-runner/builds/0aa902b1/0/paas/message/message-provider/target/surefire/surefire1560965759779144679tmp /opt/f/.m2/gitlab-runner/builds/0aa902b1/0/paas/message/essage-provider/target/surefire/surefire_09112026330459044785tmp
[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
[ERROR] 
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR]   mvn <goals> -rf :message-provider
Last login: Wed Dec 14 15:12:47 CST 2016

自己查找了半天,才知道原来在写单元测试的时候,测试结束时写了一行 System.exit(0); 造成了vm提前退出,去掉之后再次执行maven install正常。

解决方式,在idea中使用Ctrl+Shift+R 查找项目中的System.exit(0)代码行,然后删除之,我的项目删除之后执行mvn install正常。

我的也是这样的,一毛一样的问题

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值