Maven Surefire plugin "Error occured in starting fork, check output in log"
40,519
You need to setup surefire plugin to use <forkMode>once</forkMode>
like this:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.5</version>
<configuration>
<skipTests>false</skipTests>
<testFailureIgnore>true</testFailureIgnore>
<forkMode>once</forkMode>
</configuration>
</plugin>
Author by
user1137387
Updated on July 16, 2022Comments
-
user1137387 almost 2 years
I get the following error
BUILD ERROR Error occured in starting fork, check output in log
when using Maven 2.2.1 and Surefire plugin 2.11 while running junit test cases.
How can I fix it?
-
Naman over 6 yearsthe option is deprecated, any updated combination to solve the issue?
-
Alban about 6 yearsI fixed it with <forkCount>0</forkCount> (instead of the deprecated forkMode).
-
Simon Ninon almost 6 yearsnotice that forkMode once is NOT the same as forkCount 0.From maven.apache.org/surefire/maven-surefire-plugin/examples/…, the equivalent would be forkCount 1 with reuseForks true. However, seems forkCount 0 fixes the issue.
-
Mançaux Pierre-Alexandre over 3 yearswith this you loose jacoco coverage on sonar...any other ideas because i m in the same situation. thanks