title: Maven surefire plugin fork mode
body: <p>By default maven surefile plugin run tests in isolated (forked) environment. You can override this behavior with following configuration:</p>
  
  <pre><code>&lt;build&gt;
    &lt;plugins&gt;
      &lt;plugin&gt;
        &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
        &lt;artifactId&gt;maven-surefire-plugin&lt;/artifactId&gt;
        &lt;configuration&gt;
          &lt;forkMode&gt;never&lt;/forkMode&gt;
        &lt;/configuration&gt;
      &lt;/plugin&gt;
    &lt;/plugins&gt;
  &lt;/build&gt;
  </code></pre>
  
  <p>If you need to debug your tests you should to use this configuration snippet. Or you could simply run maven build the following way:</p>
  
  <pre><code>$ mvn -Dmaven.surefire.debug tests
  </code></pre>
  
  <p>This will starts a debugger on the port 5005.</p>
  
  <p>My question is: what benefits have forking strategy and why is chosen as a default strategy for maven build? Isn't nonforking strategy is more straightforward and therefore should be used as default (maven is convention over configuration tool, right)?</p>