title: How to run Maven surefire where each test class has its own parallel JVM?
body: <p>No matter what settings I use for Maven + Surefire, I never see more than a single JVM spawned in my process manager.  I have a Windows 7 PC with 8 physical cores.  I am running the latest Maven / Surefire / JUnit and JDK8 (32-bit).</p>
  
  <p>I tried decomposing all my tests into one test per test class.  (I read that JVMs are only spawned for test classes, not test methods.)  Still, I never see more than one JVM in process manager.</p>
  
  <p>Ideally, I would like each test class to run a separate JVM -- 8 in parallel (one for each core / do not resuse JVMs).</p>
  
  <p>What are the required Maven Surefire settings?</p>
  
  <p>The following does not work for me:</p>
  
  <pre><code>        &lt;plugin&gt;
              &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
              &lt;artifactId&gt;maven-surefire-plugin&lt;/artifactId&gt;
              &lt;version&gt;${maven-surefire-plugin.version}&lt;/version&gt;
              &lt;configuration&gt;
                  &lt;includes&gt;
                      &lt;include&gt;${default.test.suite}&lt;/include&gt;
                  &lt;/includes&gt;
                  &lt;reuseForks&gt;false&lt;/reuseForks&gt;
                  &lt;forkCount&gt;1.0C&lt;/forkCount&gt;
                  &lt;parallel&gt;classes&lt;/parallel&gt;
                  &lt;threadCount&gt;1&lt;/threadCount&gt;
  &lt;!--
                  &lt;useUnlimitedThreads&gt;true&lt;/useUnlimitedThreads&gt;
                  &lt;parallelOptimized&gt;false&lt;/parallelOptimized&gt;
  --&gt;
              &lt;/configuration&gt;
          &lt;/plugin&gt;
  </code></pre>
  
  <p>(I tried various combinations of <code>reuseForks</code>, <code>forkCount</code>, <code>parallel</code>, <code>threadCount</code>, <code>useUnlimitedThreads</code>, and <code>parallelOptimized</code>.)</p>