昨天打包项目的时候,进行maven install遇到了这个问题
[WARNING] Corrupted STDOUT by directly writing to native stream in forked JVM 1
查阅之后在starkoverFlow找到了相关的问题解答
作者说:
Dropping the surefire version to 2.18 stops the jvm from crashing but does not execute the tests. Any version of surefire above 2.18 including the latest crashes the build with the errors above.
I am clearly not the only one experiencing the issue as it is also shown here
Furthermore the issue is also known by the surefire development community as it is discussed here
That said, unlike most issues that tend to be resolved in more recent version of plugins, this issue appears to raise its ugly head again with the more recent versions of surefire and the jvm.
翻译过来就是说Maven的surefire插件版本如果超过2.18,那么就会报这个错误,建议你把该插件版本降到2.18及以下。
然后我查看了我项目中这个插件的版本,发现确实是超过了2.18
但是肯定是不能直接降插件版本的,因为除了插件问题,测试类也可能有问题,所以只要跳过测试类即可,如果你是idea开发环境,直接在配置里勾选跳过测试即可
至此问题解决,但是如果你需要测试类,你可能需要按照上面那个老哥说的降一下版本。