title: Cucumber not running in parallel with Maven
body: <p>I'm trying to run my Cucumber tests with Selenium in parallel using Maven. <strong>I tried maven surefire plugin and failsafe plugin and even old cucumber jvm parallel plugin.</strong> I've got the same result. My tests run in sequence without parallelization.</p>
  
  <p>I've tried to configure maven-surefire-plugin and then maven-failsafe-plugin. Nothing helps.</p>
  
  <p>Here is my pom.xml file</p>
  
  <pre><code>        &lt;plugins&gt;
              &lt;plugin&gt;
                  &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
                  &lt;artifactId&gt;maven-compiler-plugin&lt;/artifactId&gt;
                  &lt;version&gt;3.8.1&lt;/version&gt;
                  &lt;configuration&gt;
                      &lt;source&gt;1.8&lt;/source&gt;
                      &lt;target&gt;1.8&lt;/target&gt;
                      &lt;encoding&gt;UTF-8&lt;/encoding&gt;
                      &lt;fork&gt;true&lt;/fork&gt;
                  &lt;/configuration&gt;
              &lt;/plugin&gt;
  
              &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;2.22.0&lt;/version&gt;
                  &lt;configuration&gt;
                      &lt;forkCount&gt;2&lt;/forkCount&gt;
                      &lt;reuseForks&gt;true&lt;/reuseForks&gt;
                      &lt;includes&gt;
                          &lt;include&gt;**/RunnerTest.class&lt;/include&gt;
                      &lt;/includes&gt;
  
                  &lt;/configuration&gt;
              &lt;/plugin&gt;
          &lt;/plugins&gt;
      &lt;/build&gt;
  
      &lt;dependencies&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.junit.jupiter&lt;/groupId&gt;
              &lt;artifactId&gt;junit-jupiter-api&lt;/artifactId&gt;
              &lt;version&gt;5.4.1&lt;/version&gt;
              &lt;scope&gt;test&lt;/scope&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;io.github.bonigarcia&lt;/groupId&gt;
              &lt;artifactId&gt;webdrivermanager&lt;/artifactId&gt;
              &lt;version&gt;3.3.0&lt;/version&gt;
              &lt;scope&gt;test&lt;/scope&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;org.seleniumhq.selenium&lt;/groupId&gt;
              &lt;artifactId&gt;selenium-java&lt;/artifactId&gt;
              &lt;version&gt;3.141.59&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;io.cucumber&lt;/groupId&gt;
              &lt;artifactId&gt;cucumber-picocontainer&lt;/artifactId&gt;
              &lt;version&gt;4.2.5&lt;/version&gt;
              &lt;scope&gt;test&lt;/scope&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;io.cucumber&lt;/groupId&gt;
              &lt;artifactId&gt;cucumber-junit&lt;/artifactId&gt;
              &lt;version&gt;4.2.6&lt;/version&gt;
              &lt;scope&gt;test&lt;/scope&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;io.cucumber&lt;/groupId&gt;
              &lt;artifactId&gt;cucumber-java&lt;/artifactId&gt;
              &lt;version&gt;4.2.6&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;io.rest-assured&lt;/groupId&gt;
              &lt;artifactId&gt;rest-assured&lt;/artifactId&gt;
              &lt;version&gt;3.3.0&lt;/version&gt;
              &lt;scope&gt;test&lt;/scope&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;com.microsoft.sqlserver&lt;/groupId&gt;
              &lt;artifactId&gt;mssql-jdbc&lt;/artifactId&gt;
              &lt;version&gt;7.3.0.jre8-preview&lt;/version&gt;
              &lt;scope&gt;test&lt;/scope&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;net.masterthought&lt;/groupId&gt;
              &lt;artifactId&gt;cucumber-reporting&lt;/artifactId&gt;
              &lt;version&gt;4.7.0&lt;/version&gt;
          &lt;/dependency&gt;
      &lt;/dependencies&gt;
  </code></pre>
  
  <p>And here my configuration of failsafe plugin. But it disabled</p>
  
  <pre><code>                &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
                  &lt;artifactId&gt;maven-failsafe-plugin&lt;/artifactId&gt;
                  &lt;version&gt;2.22.0&lt;/version&gt;
                  &lt;executions&gt;
                      &lt;execution&gt;
                          &lt;id&gt;acceptance-test&lt;/id&gt;
                          &lt;phase&gt;integration-test&lt;/phase&gt;
                          &lt;goals&gt;
                              &lt;goal&gt;integration-test&lt;/goal&gt;
                              &lt;goal&gt;verify&lt;/goal&gt;
                          &lt;/goals&gt;
                          &lt;configuration&gt;
                              &lt;rerunFailingTestsCount&gt;1&lt;/rerunFailingTestsCount&gt;
                              &lt;testFailureIgnore&gt;true&lt;/testFailureIgnore&gt;
                              &lt;includes&gt;
                                  &lt;include&gt;**/RunnerTest.class&lt;/include&gt;
                                  &lt;include&gt;**/*IT.class&lt;/include&gt;
                              &lt;/includes&gt;
                              &lt;forkCount&gt;2&lt;/forkCount&gt;
                              &lt;reuseForks&gt;true&lt;/reuseForks&gt;
                              &lt;perCoreThreadCount&gt;false&lt;/perCoreThreadCount&gt;
                              &lt;reportsDirectory&gt;target&lt;/reportsDirectory&gt;
                          &lt;/configuration&gt;
                      &lt;/execution&gt;
                  &lt;/executions&gt;
              &lt;/plugin&gt;
  </code></pre>
  
  <p>And my Runner class</p>
  
  <pre><code>@RunWith(Cucumber.class)
  @CucumberOptions(
          features = "src/test/java/features",
          glue = "step_definitions",
          plugin = {"pretty", "html:target/cucumberHtmlReport", "json:target/cucumber-report.json"},
          monochrome = true,
          strict = true
  )
  public class RunnerTest {
  
  }
  </code></pre>
  
  <p>To run my tests in Maven I use this command:</p>
  
  <pre><code>mvn clean verify "-Dcucumber.options=--tags @Test-1,@Test-2" -Dbrowser=chrome
  </code></pre>
  
  <p>In addition I can say that I'm using static webDriver and Singleton class for handling properties. I have no idea how it can impact but it's FYI. I can provide code if required.</p>
  
  <p>For now I'm looking to run my tests in forks because threads handling is another big deal.</p>