我前一段时间正在开发一个应用程序,在长时间制动后,我重新打开了它,尝试更改某些内容并构建应用程序。
现在,当我尝试构建应用程序时,我有一个Maven
的问题您能看一下错误并支持我,我应该更改/添加?
我第一次看到这个问题,真的不知道怎么了,尤其是一个月前它的工作正常。
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 4.641 s
[INFO] Finished at: 2019-03-04T09:02:26+01:00
[INFO] Final Memory: 24M/464M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.21.0:test (default-test) on project myapplication: There are test failures.
[ERROR]
[ERROR] Please refer to D:JAVAJAVAJAVAJAVAtargetsurefire-reports for the individual test results.
[ERROR] Please refer to dump files (if any exist) [date]-jvmRun[N].dump, [date].dumpstream and [date]-jvmRun[N].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 FilesJavajdk1.8.0_181jrebinjava" -jar C:UsersuserAppDataLocalTempsurefire3153501061038019130surefirebooter5461745518324810198.jar C:UsersuserAppDataLocalTempsurefire3153501061038019130 2019-03-04T09-02-23_668-jvmRun1 surefire5550337711472069686tmp surefire_01955205028093789027tmp"
[ERROR] Error occurred in starting fork, check output in log
[ERROR] Process Exit Code: 1
[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 FilesJavajdk1.8.0_181jrebinjava" -jar C:UsersuserAppDataLocalTempsurefire3153501061038019130surefirebooter5461745518324810198.jar C:UsersuserAppDataLocalTempsurefire3153501061038019130 2019-03-04T09-02-23_668-jvmRun1 surefire5550337711472069686tmp surefire_01955205028093789027tmp"
[ERROR] Error occurred in starting fork, check output in log
[ERROR] Process Exit Code: 1
[ERROR] at org.apache.maven.plugin.surefire.booterclient.ForkStarter.fork(ForkStarter.java:671)
[ERROR] at org.apache.maven.plugin.surefire.booterclient.ForkStarter.fork(ForkStarter.java:533)
...
[ERROR] at org.apache.maven.cli.MavenCli.main(MavenCli.java:199)
[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)
[ERROR] at org.codehaus.classworlds.Launcher.main(Launcher.java:47)
[ERROR] -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.21.0:test (default-test) on project myapplication: There are test failures.
Please refer to D:JAVAJAVAJAVAJAVAtargetsurefire-reports for the individual test results.
Please refer to dump files (if any exist) [date]-jvmRun[N].dump, [date].dumpstream and [date]-jvmRun[N].dumpstream.
The forked VM terminated without properly saying goodbye. VM crash or System.exit called?
Command was cmd.exe /X /C ""C:Program FilesJavajdk1.8.0_181jrebinjava" -jar C:UsersuserAppDataLocalTempsurefire3153501061038019130surefirebooter5461745518324810198.jar C:UsersuserAppDataLocalTempsurefire3153501061038019130 2019-03-04T09-02-23_668-jvmRun1 surefire5550337711472069686tmp surefire_01955205028093789027tmp"
Error occurred in starting fork, check output in log
Process Exit Code: 1
org.apache.maven.surefire.booter.SurefireBooterForkException: The forked VM terminated without properly saying goodbye. VM crash or System.exit called?
Command was cmd.exe /X /C ""C:Program FilesJavajdk1.8.0_181jrebinjava" -jar C:UsersuserAppDataLocalTempsurefire3153501061038019130surefirebooter5461745518324810198.jar C:UsersuserAppDataLocalTempsurefire3153501061038019130 2019-03-04T09-02-23_668-jvmRun1 surefire5550337711472069686tmp surefire_01955205028093789027tmp"
Error occurred in starting fork, check output in log
Process Exit Code: 1
at org.apache.maven.plugin.surefire.booterclient.ForkStarter.fork(ForkStarter.java:671)
at org.apache.maven.plugin.surefire.booterclient.ForkStarter.fork(ForkStarter.java:533)
at org.apache.maven.plugin.surefire.booterclient.ForkStarter.run(ForkStarter.java:278)
at org.apache.maven.plugin.surefire.booterclient.ForkStarter.run(ForkStarter.java:244)
....
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:863)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:199)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
at org.codehaus.classworlds.Launcher.main(Launcher.java:47)
Caused by: org.apache.maven.plugin.MojoExecutionException: There are test failures.
测试是:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.21.0:test (default-test) on project application: There are test failures.
[ERROR]
[ERROR] Please refer to D:JAVAJAVAJAVAJAVAtargetsurefire-reports for the individual test results.
[ERROR] Please refer to dump files (if any exist) [date]-jvmRun[N].dump, [date].dumpstream and [date]-jvmRun[N].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 FilesJavajdk1.8.0_181jrebinjava" -jar C:UsersuserAppDataLocalTempsurefire1234626952071494241surefirebooter706544173501739081.jar C:UsersuserAppDataLocalTempsurefire1234626952071494241 2019-03-04T09-28-58_374-jvmRun1 surefire700658503828727378tmp surefire_09037920200833720438tmp"
[ERROR] Error occurred in starting fork, check output in log
[ERROR] Process Exit Code: 1
[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 FilesJavajdk1.8.0_181jrebinjava" -jar C:UsersuserAppDataLocalTempsurefire1234626952071494241surefirebooter706544173501739081.jar C:UsersuserAppDataLocalTempsurefire1234626952071494241 2019-03-04T09-28-58_374-jvmRun1 surefire700658503828727378tmp surefire_09037920200833720438tmp"
[ERROR] Error occurred in starting fork, check output in log
[ERROR] Process Exit Code: 1
[ERROR] at org.apache.maven.plugin.surefire.booterclient.ForkStarter.fork(ForkStarter.java:671)
[ERROR] at org.apache.maven.plugin.surefire.booterclient.ForkStarter.fork(ForkStarter.java:533)
[ERROR] at org.apache.maven.plugin.surefire.booterclient.ForkStarter.run(ForkStarter.java:278)
...
[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)
[ERROR] at org.codehaus.classworlds.Launcher.main(Launcher.java:47)
[ERROR] -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.21.0:test (default-test) on project application: There are test failures.
Please refer to D:JAVAJAVAJAVAJAVAtargetsurefire-reports for the individual test results.
Please refer to dump files (if any exist) [date]-jvmRun[N].dump, [date].dumpstream and [date]-jvmRun[N].dumpstream.
The forked VM terminated without properly saying goodbye. VM crash or System.exit called?
Command was cmd.exe /X /C ""C:Program FilesJavajdk1.8.0_181jrebinjava" -jar C:UsersuserAppDataLocalTempsurefire1234626952071494241surefirebooter706544173501739081.jar C:UsersuserAppDataLocalTempsurefire1234626952071494241 2019-03-04T09-28-58_374-jvmRun1 surefire700658503828727378tmp surefire_09037920200833720438tmp"
Error occurred in starting fork, check output in log
Process Exit Code: 1
org.apache.maven.surefire.booter.SurefireBooterForkException: The forked VM terminated without properly saying goodbye. VM crash or System.exit called?
Command was cmd.exe /X /C ""C:Program FilesJavajdk1.8.0_181jrebinjava" -jar C:UsersuserAppDataLocalTempsurefire1234626952071494241surefirebooter706544173501739081.jar C:UsersuserAppDataLocalTempsurefire1234626952071494241 2019-03-04T09-28-58_374-jvmRun1 surefire700658503828727378tmp surefire_09037920200833720438tmp"
Error occurred in starting fork, check output in log
Process Exit Code: 1
at org.apache.maven.plugin.surefire.booterclient.ForkStarter.fork(ForkStarter.java:671)
at org.apache.maven.plugin.surefire.booterclient.ForkStarter.fork(ForkStarter.java:533)
at org.apache.maven.plugin.surefire.booterclient.ForkStarter.run(ForkStarter.java:278)
at org.apache.maven.plugin.surefire.booterclient.ForkStarter.run(ForkStarter.java:244)
at org.apache.maven.plugin.surefire.AbstractSurefireMojo.executeProvider(AbstractSurefireMojo.java:1149)
at org.apache.maven.plugin.surefire.AbstractSurefireMojo.executeAfterPreconditionsChecked(AbstractSurefireMojo.java:978)
...
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
at org.codehaus.classworlds.Launcher.main(Launcher.java:47)
Caused by: org.apache.maven.plugin.MojoExecutionException: There are test failures.
Please refer to D:JAVAJAVAJAVAJAVAtargetsurefire-reports for the individual test results.
Please refer to dump files (if any exist) [date]-jvmRun[N].dump, [date].dumpstream and [date]-jvmRun[N].dumpstream.
The forked VM terminated without properly saying goodbye. VM crash or System.exit called?
Command was cmd.exe /X /C ""C:Program FilesJavajdk1.8.0_181jrebinjava" -jar C:UsersuserAppDataLocalTempsurefire1234626952071494241surefirebooter706544173501739081.jar C:UsersuserAppDataLocalTempsurefire1234626952071494241 2019-03-04T09-28-58_374-jvmRun1 surefire700658503828727378tmp surefire_09037920200833720438tmp"
Error occurred in starting fork, check output in log
Process Exit Code: 1
org.apache.maven.surefire.booter.SurefireBooterForkException: The forked VM terminated without properly saying goodbye. VM crash or System.exit called?
Command was cmd.exe /X /C ""C:Program FilesJavajdk1.8.0_181jrebinjava" -jar C:UsersuserAppDataLocalTempsurefire1234626952071494241surefirebooter706544173501739081.jar C:UsersuserAppDataLocalTempsurefire1234626952071494241 2019-03-04T09-28-58_374-jvmRun1 surefire700658503828727378tmp surefire_09037920200833720438tmp"
Error occurred in starting fork, check output in log
在日志文件中我看到
# Created on 2019-03-04T09:29:00.628
Killing self fork JVM. Maven process died.
来自终端:
将-DskipTests
添加到mvn
命令中,作为解决方法。例如:
mvn package -DskipTests
这可以很好地构建包装。
来自Intellij,如您提到的,您可以执行以下操作:
查看>工具窗口> Maven项目单击称为跳过测试模式的按钮。本质上,当您说运行软件包时,它将测试阶段退出生命周期。
我希望暂时有所帮助,除非解决测试案例的问题。