我正在尝试升级团队维护的Java应用程序的依赖关系。该应用程序基于SpringBoot,用于将spring-boot-starter-parent:1.5.6.RELEASE
声明为其父级。
升级后,应用程序将spring-boot-starter-parent:2.1.8.RELEASE
声明为其父级。这是我的pom.xml文件的差异:
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
- <version>1.5.6.RELEASE</version>
+ <version>2.1.8.RELEASE</version>
<relativePath/>
</parent>
现在mvn -X clean test
失败,但出现以下异常:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.22.2:test (default-test) on project scimapi: There are test failures.
[ERROR]
[ERROR] Please refer to C:\Users\musikpolice\Documents\git\scimapi\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 cmd.exe /X /C ""C:\Program Files\Java\jdk1.8.0_191\jre\bin\java" -jar C:\Users\musikpolice\AppData\Local\Temp\surefire4062831518056119279\surefirebooter1476719102492403846.jar C:\Users\musikpolice\AppData\Local\Temp\surefire4062831518056119279 2019-10-01T11-33-46_847-jvmRun1 surefire6827784388561767102tmp surefire_04733578287828383905tmp"
[ERROR] Process Exit Code: 0
[ERROR] Crashed tests:
[ERROR] com.mycompany.scim.controllers.SomeControllerTest
[ERROR] org.apache.maven.surefire.booter.SurefireBooterForkException: The forked VM terminated without properly saying goodbye. VM crash or System.exit called?
[ERROR] Command was cmd.exe /X /C ""C:\Program Files\Java\jdk1.8.0_191\jre\bin\java" -jar C:\Users\musikpolice\AppData\Local\Temp\surefire4062831518056119279\surefirebooter1476719102492403846.jar C:\Users\musikpolice\AppData\Local\Temp\surefire4062831518056119279 2019-10-01T11-33-46_847-jvmRun1 surefire6827784388561767102tmp surefire_04733578287828383905tmp"
[ERROR] Process Exit Code: 0
[ERROR] Crashed tests:
[ERROR] com.mycompany.scim.controllers.SomeControllerTest
[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)
[ERROR] at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:154)
[ERROR] at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:146)
[ERROR] at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:117)
[ERROR] at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:81)
[ERROR] at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:56)
[ERROR] at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
[ERROR] at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:305)
[ERROR] at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:192)
[ERROR] at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:105)
[ERROR] at org.apache.maven.cli.MavenCli.execute(MavenCli.java:954)
[ERROR] at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288)
[ERROR] at org.apache.maven.cli.MavenCli.main(MavenCli.java:192)
[ERROR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[ERROR] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
[ERROR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[ERROR] at java.lang.reflect.Method.invoke(Method.java:498)
[ERROR] at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
[ERROR] at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
[ERROR] at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
[ERROR] at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
测试输出中提到的C:\Users\musikpolice\Documents\git\scimapi\target\surefire-reports
目录不存在。我也找不到在输出中引用的转储文件。
我的Maven / Java版本如下:
Apache Maven 3.5.4 (1edded0938998edf8bf061f1ceb3cfdeccf443fe; 2018-06-17T14:33:14-04:00)
Maven home: C:\ProgramData\chocolatey\lib\maven\apache-maven-3.5.4\bin\..
Java version: 1.8.0_191, vendor: Oracle Corporation, runtime: C:\Program Files\Java\jdk1.8.0_191\jre
Default locale: en_US, platform encoding: Cp1252
OS name: "windows 10", version: "10.0", arch: "amd64", family: "windows"
我没有在pom.xml的“构建”>“插件”部分中明确声明maven-surefire-plugin
的版本,但是添加对该插件的2.22.2的明确引用不能解决问题。
值得注意的是,在@Ignored
上添加了com.mycompany.scim.controllers.SomeControllerTest
注释并不能解决问题-下一个测试仅以相同的方式失败。
有趣的是,代码被编译并且所有测试都通过了IntelliJ。我只是在使用Maven运行构建时才遇到此问题,这告诉我该问题可能是我的工具链中元素的某些版本不匹配,但我真的不知道还有什么要解决的问题。