1

When I run in my command line mvn clean test I get the following failure

[INFO] ------------------------------------------------------------------------                                                                                                                                                               
[INFO] BUILD FAILURE                                                                                                                                                                                                                          
[INFO] ------------------------------------------------------------------------                                                                                                                                                               
[INFO] Total time: 17.703 s                                                                                                                                                                                                                   
[INFO] Finished at: 2018-09-04T07:14:01+01:00                                                                                                                                                                                                 
[INFO] Final Memory: 46M/549M                                                                                                                                                                                                                 
[INFO] ------------------------------------------------------------------------                                                                                                                                                               
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.20.1:test (default-test) on project <projectname>: There are test failures.                                                                            
[ERROR]                                                                                                                                                                                                                                       
[ERROR] Please refer to c:\username\Dev\workspaceIntellij\projectname\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:\username\Dev\jdk1.8\jre\bin\java -jar C:\Users\username\AppData\Local\Temp\surefire7773794300145922453\surefirebooter7859772817341969410.jar C:\Users\username\AppData\Local\Temp\surefire777379430014592245
3 2018-09-04T07-13-59_140-jvmRun1 surefire8109947353298297465tmp surefire_06749094174024198560tmp"                                                                                                                                            
[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:\username\Dev\jdk1.8\jre\bin\java -jar C:\Users\username\AppData\Local\Temp\surefire7773794300145922453\surefirebooter7859772817341969410.jar C:\Users\username\AppData\Local\Temp\surefire777379430014592245
3 2018-09-04T07-13-59_140-jvmRun1 surefire8109947353298297465tmp surefire_06749094174024198560tmp"                                                                                                                                            
[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:686)                                                                                                                                       
[ERROR]         at org.apache.maven.plugin.surefire.booterclient.ForkStarter.fork(ForkStarter.java:535)                                                                                                                                       
[ERROR]         at org.apache.maven.plugin.surefire.booterclient.ForkStarter.run(ForkStarter.java:280)                                                                                                                                        
[ERROR]         at org.apache.maven.plugin.surefire.booterclient.ForkStarter.run(ForkStarter.java:245)                                                                                                                                        
[ERROR]         at org.apache.maven.plugin.surefire.AbstractSurefireMojo.executeProvider(AbstractSurefireMojo.java:1124)                                                                                                                      
[ERROR]         at org.apache.maven.plugin.surefire.AbstractSurefireMojo.executeAfterPreconditionsChecked(AbstractSurefireMojo.java:954)                                                                                                      
[ERROR]         at org.apache.maven.plugin.surefire.AbstractSurefireMojo.execute(AbstractSurefireMojo.java:832)                                                                                                                               
[ERROR]         at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)                                                                                                                          
[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:51)                                                                                                      
[ERROR]         at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)                                                                                                                                    
[ERROR]         at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:309)                                                                                                                                                             
[ERROR]         at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:194)                                                                                                                                                             
[ERROR]         at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:107)                                                                                                                                                               
[ERROR]         at org.apache.maven.cli.MavenCli.execute(MavenCli.java:955)                                                                                                                                                                   
[ERROR]         at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:290)                                                                                                                                                                    
[ERROR]         at org.apache.maven.cli.MavenCli.main(MavenCli.java:194)                                                                                                                                                                      
[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]                                                                                                                                                                                                                                       
[ERROR] -> [Help 1] 

In the surefire-report it says

# Created on 2018-09-04T07:34:08.345
Killing self fork JVM. Maven process died.

These are my maven and java versions:

  • Maven home: c:\username\Dev\apache-maven-3.5.2
  • Java version: 1.8, vendor: Oracle Corporation
  • Java home: c:\username\Dev\jdk1.8\jre

When I run mvn clean test from intellij it works. It uses /c/Program Files (x86)/Jetbrains/IntelliJ IDEA Ultimate 17.2.2/plugins/maven/lib/maven3/bin/mvn and it also works when I paste that in the command line.

Thanks for the help

tenticon
  • 2,639
  • 4
  • 32
  • 76

2 Answers2

0

In my case (openjdk11, maven 3.6, docker on windows 10) the solution was to update maven-surefire-plugin from 2.21.0 to 2.22.2.

Horst Krause
  • 636
  • 7
  • 22
-2

Looks that its duplicate of surefire-error

The solution was:

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-surefire-plugin</artifactId>

    <version>XXXXXXXXX.XXXXXX-some-version</version>

    <!-- ADD THIS: --->
    <configuration>
        <skipTests>false</skipTests>
        <testFailureIgnore>true</testFailureIgnore>
        <forkMode>once</forkMode>
    </configuration>
</plugin> 
Yehuda
  • 457
  • 2
  • 6
  • 16