1

I am running my tests with spring boot. Also I am using OpenJdk-11 and maven version 3.6.3:

<plugin>
   <groupId>org.apache.maven.plugins</groupId>
   <artifactId>maven-surefire-plugin</artifactId>
   <version>3.0.0-M3</version>
   <dependencies>
      <dependency>
         <groupId>org.apache.maven.surefire</groupId>
         <artifactId>surefire-junit47</artifactId>
         <version>3.0.0-M3</version>
      </dependency>
   </dependencies>
   <configuration>
      <useSystemClassLoader>false</useSystemClassLoader>
      <suiteXmlFiles>
         <suiteXmlFile>src/test/resources/testng.xml</suiteXmlFile>
      </suiteXmlFiles>
      <forkCount>3</forkCount>
      <skipTests>false</skipTests>
      <reuseForks>false</reuseForks>
      <testFailureIgnore>true</testFailureIgnore>
   </configuration>
</plugin>

This is my pom configuration. After running mvn test. Below exception is coming- Execution default-test of goal org.apache.maven.plugins:maven-surefire-plugin:3.0.0-M3:test failed: java.lang.ClassNotFoundException: org.apache.maven.plugin.surefire.StartupReportConfiguration

I tried with multiple combination but did not work. Any help would be appreciated.

After removing the configuration element it throws -

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\jdk-11.0.2\bin\java" -Dmaven.test.failure.ignore=true -XX:-UseGCOverheadLimit -Xms256m -XX:MaxPermSize=512M -Xmx2048m -Dcom.yodlee.debugJDBC=true -Dcom.yodlee.debugJDBCFile=d:\\jdbc.log -Xdebug -Xrunjdwp:transport=dt_socket,address=2122,server=y,suspend=n -Dcom.yodlee.test.debugMVC=true -Dcom.yodlee.DecryptDisabled=true -Dfile.encoding=UTF-8 @C:\Users\vishnu.dubey\AppData\Local\Temp\surefire9547159012968324662\surefireargs7816964037106790246 C:\Users\vishnu.dubey\AppData\Local\Temp\surefire9547159012968324662 2020-10-11T20-09-14_233-jvmRun1 surefire4758013377922290878tmp surefire_012795561266241511869tmp"
[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\jdk-11.0.2\bin\java" -Dmaven.test.failure.ignore=true -XX:-UseGCOverheadLimit -Xms256m -XX:MaxPermSize=512M -Xmx2048m -Dcom.yodlee.debugJDBC=true -Dcom.yodlee.debugJDBCFile=d:\\jdbc.log -Xdebug -Xrunjdwp:transport=dt_socket,address=2122,server=y,suspend=n -Dcom.yodlee.test.debugMVC=true -Dcom.yodlee.DecryptDisabled=true -Dfile.encoding=UTF-8 @C:\Users\vishnu.dubey\AppData\Local\Temp\surefire9547159012968324662\surefireargs7816964037106790246 C:\Users\vishnu.dubey\AppData\Local\Temp\surefire9547159012968324662 2020-10-11T20-09-14_233-jvmRun1 surefire4758013377922290878tmp surefire_012795561266241511869tmp"
[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:670)
[ERROR]         at org.apache.maven.plugin.surefire.booterclient.ForkStarter.run(ForkStarter.java:283)
[ERROR]         at org.apache.maven.plugin.surefire.booterclient.ForkStarter.run(ForkStarter.java:246)
[ERROR]         at org.apache.maven.plugin.surefire.AbstractSurefireMojo.executeProvider(AbstractSurefireMojo.java:1161)
[ERROR]         at org.apache.maven.plugin.surefire.AbstractSurefireMojo.executeAfterPreconditionsChecked(AbstractSurefireMojo.java:1002)
[ERROR]         at org.apache.maven.plugin.surefire.AbstractSurefireMojo.execute(AbstractSurefireMojo.java:848)
[ERROR]         at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:137)
[ERROR]         at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:210)
[ERROR]         at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:156)
[ERROR]         at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:148)
[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:957)
[ERROR]         at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:289)
[ERROR]         at org.apache.maven.cli.MavenCli.main(MavenCli.java:193)

Any help?

Debargha Roy
  • 2,320
  • 1
  • 15
  • 34
Vishnu Dubey
  • 141
  • 1
  • 3
  • 10

1 Answers1

1

Upgrading the version of the plugin to 3.0.0-M4 should solve the problem.

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

The issue was tracked here

laffuste
  • 16,287
  • 8
  • 84
  • 91
Debargha Roy
  • 2,320
  • 1
  • 15
  • 34