繁体   English   中英

Spring Boot应用程序-Maven问题

[英]Spring Boot Application - Maven Issue

我前一段时间正在开发一个应用程序,经过漫长的刹车后,我重新打开了它并尝试更改某些内容并构建应用程序。

现在,当我尝试构建applicaton时,我遇到了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:\JAVA\JAVA\JAVA\JAVA\target\surefire-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 Files\Java\jdk1.8.0_181\jre\bin\java" -jar C:\Users\user\AppData\Local\Temp\surefire3153501061038019130\surefirebooter5461745518324810198.jar C:\Users\user\AppData\Local\Temp\surefire3153501061038019130 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 Files\Java\jdk1.8.0_181\jre\bin\java" -jar C:\Users\user\AppData\Local\Temp\surefire3153501061038019130\surefirebooter5461745518324810198.jar C:\Users\user\AppData\Local\Temp\surefire3153501061038019130 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:\JAVA\JAVA\JAVA\JAVA\target\surefire-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 Files\Java\jdk1.8.0_181\jre\bin\java" -jar C:\Users\user\AppData\Local\Temp\surefire3153501061038019130\surefirebooter5461745518324810198.jar C:\Users\user\AppData\Local\Temp\surefire3153501061038019130 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 Files\Java\jdk1.8.0_181\jre\bin\java" -jar C:\Users\user\AppData\Local\Temp\surefire3153501061038019130\surefirebooter5461745518324810198.jar C:\Users\user\AppData\Local\Temp\surefire3153501061038019130 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:\JAVA\JAVA\JAVA\JAVA\target\surefire-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 Files\Java\jdk1.8.0_181\jre\bin\java" -jar C:\Users\user\AppData\Local\Temp\surefire1234626952071494241\surefirebooter706544173501739081.jar C:\Users\user\AppData\Local\Temp\surefire1234626952071494241 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 Files\Java\jdk1.8.0_181\jre\bin\java" -jar C:\Users\user\AppData\Local\Temp\surefire1234626952071494241\surefirebooter706544173501739081.jar C:\Users\user\AppData\Local\Temp\surefire1234626952071494241 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:\JAVA\JAVA\JAVA\JAVA\target\surefire-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 Files\Java\jdk1.8.0_181\jre\bin\java" -jar C:\Users\user\AppData\Local\Temp\surefire1234626952071494241\surefirebooter706544173501739081.jar C:\Users\user\AppData\Local\Temp\surefire1234626952071494241 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 Files\Java\jdk1.8.0_181\jre\bin\java" -jar C:\Users\user\AppData\Local\Temp\surefire1234626952071494241\surefirebooter706544173501739081.jar C:\Users\user\AppData\Local\Temp\surefire1234626952071494241 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:\JAVA\JAVA\JAVA\JAVA\target\surefire-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 Files\Java\jdk1.8.0_181\jre\bin\java" -jar C:\Users\user\AppData\Local\Temp\surefire1234626952071494241\surefirebooter706544173501739081.jar C:\Users\user\AppData\Local\Temp\surefire1234626952071494241 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 Files\Java\jdk1.8.0_181\jre\bin\java" -jar C:\Users\user\AppData\Local\Temp\surefire1234626952071494241\surefirebooter706544173501739081.jar C:\Users\user\AppData\Local\Temp\surefire1234626952071494241 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项目,单击名为“跳过测试模式”的按钮。 从本质上讲,当您说运行软件包时,它将使测试阶段脱离生命周期。

我希望它可以暂时解决问题,除非解决了测试用例的问题。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM