问题
I am running some tests for Spring Boot app in Team City using the maven surefire plugin version 2.22.1. Spring Boot version is 2.1.2. I have specified in the configuration to use a forked Java 11 jvm as follows:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<forkCount>1</forkCount>
<jvm>${jdk11.home}/bin/java</jvm>
<argLine>-Xmx1024m -XX:MaxPermSize=256m</argLine>
</configuration>
</plugin>
When running Team City I get the error in the log:
[11:07:59][Step 6/6] [ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.22.1:test (default-test) on project ep-elm-web: There are test failures.
[11:07:59][Step 6/6] [ERROR]
[11:07:59][Step 6/6] [ERROR] Please refer to /opt/*******/buildAgent/work/3c34aba90580ae72/ep-elm-web/target/surefire-reports for the individual test results.
[11:07:59][Step 6/6] [ERROR] Please refer to dump files (if any exist) [date].dump, [date]-jvmRun[N].dump and [date].dumpstream.
[11:07:59][Step 6/6] [ERROR] The forked VM terminated without properly saying goodbye. VM crash or System.exit called?
[11:07:59][Step 6/6] [ERROR] Command was /bin/sh -c cd /opt/*******/buildAgent/work/3c34aba90580ae72/ep-elm-web && /opt/jdk-11.0.2/bin/java -Xmx1024m -XX:MaxPermSize=256m -javaagent:/opt/*******/buildAgent/tools/jacoco.0.7.5/jacocoagent.jar=append=true,destfile=/opt/*******/buildAgent/temp/buildTmp/JACOCO158546265956865605coverage/jacoco.exec org.apache.maven.surefire.booter.ForkedBooter /opt/*******/buildAgent/work/3c34aba90580ae72/ep-elm-web/target/surefire 2019-02-20T11-07-58_396-jvmRun1 surefire6001620761776512056tmp surefire_02647190773594316116tmp
[11:07:59][Step 6/6] [ERROR] Error occurred in starting fork, check output in log
[11:07:59][Step 6/6] [ERROR] Process Exit Code: 134
[11:07:59][Step 6/6] [ERROR] org.apache.maven.surefire.booter.SurefireBooterForkException: The forked VM terminated without properly saying goodbye. VM crash or System.exit called?
[11:07:59][Step 6/6] [ERROR] Command was /bin/sh -c cd /opt/*******/buildAgent/work/3c34aba90580ae72/ep-elm-web && /opt/jdk-11.0.2/bin/java -Xmx1024m -XX:MaxPermSize=256m -javaagent:/opt/*******/buildAgent/tools/jacoco.0.7.5/jacocoagent.jar=append=true,destfile=/opt/*******/buildAgent/temp/buildTmp/JACOCO158546265956865605coverage/jacoco.exec org.apache.maven.surefire.booter.ForkedBooter /opt/*******/buildAgent/work/3c34aba90580ae72/ep-elm-web/target/surefire 2019-02-20T11-07-58_396-jvmRun1 surefire6001620761776512056tmp surefire_02647190773594316116tmp
[11:07:59][Step 6/6] [ERROR] Error occurred in starting fork, check output in log
[11:07:59][Step 6/6] [ERROR] Process Exit Code: 134
[11:07:59][Step 6/6] [ERROR] at org.apache.maven.plugin.surefire.booterclient.ForkStarter.fork(ForkStarter.java:669)
I have gone on to check the output in the log file and this is what I get:
Corrupted STDOUT by directly writing to native stream in forked JVM 1. Stream 'FATAL ERROR i
n native method: processing of -javaagent failed'.
java.lang.IllegalArgumentException: Stream stdin corrupted. Expected comma after third chara
cter 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(ForkC
lient.java:210)
at org.apache.maven.plugin.surefire.booterclient.output.ForkClient.consumeLine(ForkC
lient.java:177)
at org.apache.maven.plugin.surefire.booterclient.output.ThreadedStreamConsumer$Pumpe
r.run(ThreadedStreamConsumer.java:88)
at java.lang.Thread.run(Thread.java:745
)
Has anyone experienced this issue and is there a way to resolve it?
来源:https://stackoverflow.com/questions/54785919/error-running-maven-surefire-test-plugin-java-11