surefire maven memory problems
Problem:
[INFO] [surefire:test {execution: default-test}]
[INFO] Surefire report directory: C:\...\target\surefire-reports
Error occurred during initialization of VM
Could not create the Java virtual machine.
Could not reserve enough space for object heap
Solution:
Edit your pom.xml and add configuration option for surefire forkMode none:
<build>
<plugins>
(...)
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<forkMode>none</forkMode>
</configuration>
</plugin>
(...)
Found all kinds of memory setting tricks elsewhere (-Dsurefire.memory=”-Xmx512m”), but your solution is the one that worked!
Thanks a bunch!