我有一个java maven项目,我使用JUnit Juniper为我的单元测试,而建设的项目,我得到下面的错误,如果我从我的本地构建相同的项目,它工作得非常好。
这是Intellij的问题吗?
我在Intellij中构建我的maven项目时面临以下问题,而当我从本地构建时,这个问题不会出现。
错误
Error Messages # [ERROR] The forked VM terminated without properly saying goodbye. VM crash or System.exit called?
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.22.2:test (default-test) on project ImplementJunit: There are test failures.
[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_221\jre\bin\java" -jar C:\Users\mnayak6\AppData\Local\Temp\surefire2741322585113384847\surefirebooter6121148917405790398.jar C:\Users\mnayak6\AppData\Local\Temp\surefire2741322585113384847 2020-04-23T15-08-00_156-jvmRun1 surefire3485996048802854818tmp surefire_08080424484537241935tmp"
[ERROR] Process Exit Code: 0
[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_221\jre\bin\java" -jar C:\Users\mnayak6\AppData\Local\Temp\surefire2741322585113384847\surefirebooter6121148917405790398.jar C:\Users\mnayak6\AppData\Local\Temp\surefire2741322585113384847 2020-04-23T15-08-00_156-jvmRun1 surefire3485996048802854818tmp surefire_08080424484537241935tmp"
[ERROR] Process Exit Code: 0
[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:134)
[ERROR] at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:207)
[ERROR] at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
[ERROR] at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
[ERROR] at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
[ERROR] at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
[ERROR] at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
[ERROR] at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
[ERROR] at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307)
[ERROR] at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)
[ERROR] at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)
[ERROR] at org.apache.maven.cli.MavenCli.execute(MavenCli.java:863)
[ERROR] at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288)
[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)
波姆。XML
<properties>
<!-- https://maven.apache.org/general.html#encoding-warning -->
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
</properties>
<dependencies>
<!-- ... -->
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<version>5.4.0 </version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<version>5.4.0</version>
<scope>test</scope>
</dependency>
<!-- ... -->
<!-- ... -->
<dependency>
<groupId>org.junit.platform</groupId>
<artifactId>junit-platform-surefire-provider</artifactId>
<version>1.2.0</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<executions>
<execution>
<id>test-compile</id>
<goals>
<goal>testCompile</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.22.2</version>
<dependencies>
<dependency>
<groupId>org.junit.platform</groupId>
<artifactId>junit-platform-surefire-provider</artifactId>
<version>1.2.0</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</build>
测试等级:
@Test
public void testGetMidDate()
{
ImplementJunit implementJunit = new ImplementJunit();
System.out.println("calling testGetMidDate() ");
String date = implementJunit.getMidDate("20200101", "20200103");
String ExpectedDate = "20200102";
assertEquals(ExpectedDate,date);
}
我在Eclipse/Maven/JDK1上转载了这个问题。8/SureFire插件。
决议:-
当我纠正了所有的运行测试后,问题就解决了。一旦所有测试都通过,错误就消失了。虽然这并没有说明问题的根本原因和确切解决方案,但我觉得这与surefire插件的默认设置有关,即在任何测试失败后跳过测试
无法执行目标org.apache.maven.plugins:maven-surefire-plugin:2.4.3:在项目smrr上测试(默认测试):有测试失败。 请参阅C:\Users\root\Downloads\smrr\target\surefire报告以了解各个测试结果- 若要查看错误的完整堆栈跟踪,请使用-e开关重新运行Maven。使用-X开关重新运行Maven以启用完整的调试日志记
我正在尝试构建maryTTS开源文本到语音引擎,但测试失败了,请帮我解决这个错误 [错误]无法执行目标组织。阿帕奇。专家插件:maven surefire插件:2.19.1:对marytts lang项目进行测试(默认测试):存在测试失败。 [ERROR][ERROR]个别测试结果请参阅 /home/avinash/lb-work/text-to-speach-engine/mary5.x/mar
执行目标组织失败。阿帕奇。专家插件:maven surefire插件:2.5-r682619-maestro-2.0.0:project ms61 webservice xxxx上的测试(默认测试):存在测试失败。这意味着什么以及如何解决它。我第一次做maven build。
这是我的pom。xml文件, 我使用eclipse,使用run as→maven build,这是我的错误信息, 结果: 错误测试: nodeCreationwith Label(neo4j.tests.Neo4jTest): org/neo4j/内核/impl/util/函数/选项$Lazy可选nodeCreationwith Label(neo4j.tests.Neo4jTest)comare
在项目上运行mvn测试时出现以下错误 [错误]执行目标组织失败。阿帕奇。专家插件:maven surefire插件:2.13:对项目tcw fip mbp进行测试(默认测试):存在测试失败。[错误] [错误]有关单个测试结果,请参阅C:\Project\workspace\RegRep2\TCW\MBP\target\surefire报告。[错误] - [错误]要查看错误的完整堆栈跟踪,请使用-e
我在maven surefire插件3.0.0-M4和maven版本3.6.3、3.6.0和3.3.9以及jdk1中遇到了这个问题。8.0_222(Ubuntu 18.0.4)。我的pom。xml如下所示: 詹金斯的产出如下: