Docker Java 11 maven test issue: SurefireBooterForkException

At work, we use Docker containers to run Behaviour Driven Development (BDD) tests. The container originally used Java 8, but the vendor server upgraded to Java 11. When installing Java 11 and maven to run the BDD (Cucumber) tests. But we encountered the following error:
[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?
Suggested fix here and stack overflow mention here. Fix = set maven surefire plugin config useSystemClassLoader = false
<plugin>
   <groupId>org.apache.maven.plugins</groupId>
   <artifactId>maven-surefire-plugin</artifactId>
   <version>3.0.0-M3</version>
   <configuration>
       <useSystemClassLoader>false</useSystemClassLoader>
   </configuration>
</plugin>
Works like a charm after this -> mvn test

One Reply to “Docker Java 11 maven test issue: SurefireBooterForkException”

Leave a Reply

Your email address will not be published. Required fields are marked *