使用 java 11 运行 Maven 构建,构建在运行测试时发出以下警告:[WARNING] Corrupted STDOUT by directly writing to native stream in forked JVM 1. See FAQ web page and the dump file /home/thomas/code/irdeto-control/fps-license-service/fps/target/surefire-reports/2019-04-11T14-05-32_318-jvmRun1.dumpstream...在构建失败后出现以下 stderr 输出:$ cat error.message[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.22.1:test (default-test) on project fps: There are test failures.[ERROR][ERROR] Please refer to /home/user/code/employer-control/fps-license-service/fps/target/surefire-reports for the individual test results.[ERROR] Please refer to dump files (if any exist) [date].dump, [date]-jvmRun[N].dump and [date].dumpstream.[ERROR] The forked VM terminated without properly saying goodbye. VM crash or System.exit called?[ERROR] Command was /bin/sh -c cd /home/user/code/employer-control/fps-license-service/fps && /usr/lib/jvm/jdk-11.0.2/bin/java '-javaagent:/home/user/.m2/repository/org/jacoco/org.jacoco.agent/0.8.0/org.jacoco.agent-0.8.0-runtime.jar=destfile=/home/user/code/employer-control/fps-license-service/fps/target/jacoco.exec,excludes=com.employer.rights.fairplay.*' -jar /home/user/code/employer-control/fps-license-service/fps/target/surefire/surefirebooter7853689441541829546.jar /home/user/code/employer-control/fps-license-service/fps/target/surefire 2019-04-11T14-05-32_318-jvmRun1 surefire11275213325677189658tmp surefire_01035200394006888746tmp[ERROR] Error occurred in starting fork, check output in log[ERROR] Process Exit Code: 134[ERROR] org.apache.maven.surefire.booter.SurefireBooterForkException: The forked VM terminated without properly saying goodbye. VM crash or System.exit called?[ERROR] Command was /bin/sh -c cd /home/user/code/employer-control/fps-license-service/fps && /usr/lib/jvm/jdk-11.0.2/bin/java '-javaagent:/home/user/.m2/repository/org/jacoco/org.jacoco.agent/0.8.0/org.jacoco.agent-0.8.0-runtime.jar=destfile=/home/user/code/employer-control/fps-license-service/fps/target/jacoco.exec,excludes=com.employer.rights.fairplay.*' -jar /home/user/code/employer-control/fps-license-service/fps/target/surefire/surefirebooter7853689441541829546.jar /home/user/code/employer-control/fps-license-service/fps/target/surefire 2019-04-11T14-05-32_318-jvmRun1 surefire11275213325677189658tmp surefire_01035200394006888746tmp[ERROR] Error occurred in starting fork, check output in log[ERROR] Process Exit Code: 134[ERROR] at org.apache.maven.plugin.surefire.booterclient.ForkStarter.fork(ForkStarter.java:669)[ERROR] at org.apache.maven.plugin.surefire.booterclient.ForkStarter.run(ForkStarter.java:282)[ERROR] at org.apache.maven.plugin.surefire.booterclient.ForkStarter.run(ForkStarter.java:245)[ERROR] at org.apache.maven.plugin.surefire.AbstractSurefireMojo.executeProvider(AbstractSurefireMojo.java:1183)[ERROR] at org.apache.maven.plugin.surefire.AbstractSurefireMojo.executeAfterPreconditionsChecked(AbstractSurefireMojo.java:1011)[ERROR] at org.apache.maven.plugin.surefire.AbstractSurefireMojo.execute(AbstractSurefireMojo.java:857)[ERROR] at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:137)[ERROR] at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)//省略栈帧以下是转储流的摘录,引用了上述错误:# Created at 2019-04-11T14:05:32.824Corrupted STDOUT by directly writing to native stream in forked JVM 1. Stream 'FATAL ERROR in native method: processing of -javaagent failed'.java.lang.IllegalArgumentException: Stream stdin corrupted. Expected comma after third character in command 'FATAL ERROR in native method: processing of -javaagent failed'. at org.apache.maven.plugin.surefire.booterclient.output.ForkClient$OperationalData.<init>(ForkClient.java:507) at org.apache.maven.plugin.surefire.booterclient.output.ForkClient.processLine(ForkClient.java:210) at org.apache.maven.plugin.surefire.booterclient.output.ForkClient.consumeLine(ForkClient.java:177) at org.apache.maven.plugin.surefire.booterclient.output.ThreadedStreamConsumer$Pumper.run(ThreadedStreamConsumer.java:88) at java.base/java.lang.Thread.run(Thread.java:834)将 surefire 版本降低到 2.18 会阻止 jvm 崩溃,但不会执行测试。任何高于 2.18 的 surefire 版本(包括最新版本)都会使构建崩溃并出现上述错误。我显然不是唯一遇到此问题的人,因为它也显示为 here此外,在讨论 here 时,Surefire 开发社区也知道该问题也就是说,与大多数倾向于在更新版本的插件中解决的问题不同,这个问题似乎在更新版本的 surefire 和 jvm 中再次引起了人们的注意。欢迎任何解决方案或变通方法。我正在使用以下版本: Apache Maven 3.5.3 (3383c37e1f9e9b3bc3df5050c29c8aff9f295297; 2018-02-24T20:49:05+01:00) Java 版本:11.0.2 ,供应商:Oracle Corporation操作系统名称:“linux”,版本:“4.15.0-47-generic”,arch:“amd64”,系列:“unix” maven.compiler.source: 1.8 maven.compiler.target: 1.8 maven-surefire-plugin.version: 2.18 (adsbygoogle = window.adsbygoogle || []).push({}); 最佳答案 不是修复,而是一种解决方法,不要同时、异步地运行测试: <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-plugin</artifactId> <version>${maven-surefire-plugin.version}</version> <configuration> <forkCount>0</forkCount> </configuration> </plugin>关于Maven surefire 插件在 java 11 上崩溃 jvm(通过直接写入 fork JVM 1 中的 native 流来破坏 STDOUT),我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/55632614/ (adsbygoogle = window.adsbygoogle || []).push({});
10-09 07:29