title: java.lang.NoSuchMethodError: cucumber.api.CucumberOptions.snippets while running Cucumber Tests with Karate Dependencies
body: <p>I have run into an issue where I am trying to create Karate Tests in my Cucumber Project.</p>
  
  <p>Here is how my Pom file looks:</p>
  
  <pre><code>        &lt;?xml version="1.0" encoding="UTF-8"?&gt;
      &lt;project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
               xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"&gt;
          &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
          &lt;groupId&gt;com.test.automation&lt;/groupId&gt;
          &lt;artifactId&gt;testautomation&lt;/artifactId&gt;
          &lt;version&gt;1.0-SNAPSHOT&lt;/version&gt;
          &lt;properties&gt;
              &lt;failsafe.fork.count&gt;1&lt;/failsafe.fork.count&gt;
              &lt;java.version&gt;1.8&lt;/java.version&gt;
              &lt;maven.build.timestamp.format&gt;yyyy-MM-dd-HHmm&lt;/maven.build.timestamp.format&gt;
              &lt;cucumber.version&gt;1.2.5&lt;/cucumber.version&gt;
              &lt;selenium.version&gt;3.0.1&lt;/selenium.version&gt;
              &lt;karate.version&gt;0.9.2&lt;/karate.version&gt;
          &lt;/properties&gt;        
          &lt;build&gt;
              &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.6.0&lt;/version&gt;
                      &lt;configuration&gt;
                          &lt;encoding&gt;UTF-8&lt;/encoding&gt;
                          &lt;source&gt;${java.version}&lt;/source&gt;
                          &lt;target&gt;${java.version}&lt;/target&gt;
                      &lt;/configuration&gt;
                  &lt;/plugin&gt;
                  &lt;!-- Cucumber parallel plugin --&gt;
                  &lt;plugin&gt;
                      &lt;groupId&gt;com.github.temyers&lt;/groupId&gt;
                      &lt;artifactId&gt;cucumber-jvm-parallel-plugin&lt;/artifactId&gt;
                      &lt;version&gt;2.2.0&lt;/version&gt;
                      &lt;executions&gt;
                          &lt;execution&gt;
                              &lt;id&gt;generateRunners&lt;/id&gt;
                              &lt;phase&gt;validate&lt;/phase&gt;
                              &lt;goals&gt;
                                  &lt;goal&gt;generateRunners&lt;/goal&gt;
                              &lt;/goals&gt;
                              &lt;configuration&gt;
                                  &lt;glue&gt;com.test.automation&lt;/glue&gt;
                                  &lt;outputDirectory&gt;${project.build.directory}/generated-test-sources/cucumber&lt;/outputDirectory&gt;
                                  &lt;featuresDirectory&gt;src/test/resources/features/&lt;/featuresDirectory&gt;
                                  &lt;cucumberOutputDir&gt;target/cucumber-reports&lt;/cucumberOutputDir&gt;
                                  &lt;format&gt;json&lt;/format&gt;
                                  &lt;filterFeaturesByTags&gt;true&lt;/filterFeaturesByTags&gt;
                                  &lt;namingScheme&gt;pattern&lt;/namingScheme&gt;
                                  &lt;parallelScheme&gt;SCENARIO&lt;/parallelScheme&gt;
                                  &lt;namingPattern&gt;{f}IT&lt;/namingPattern&gt;
                              &lt;/configuration&gt;
                          &lt;/execution&gt;
                      &lt;/executions&gt;
                  &lt;/plugin&gt;
              &lt;/plugins&gt;
          &lt;/build&gt;   
          &lt;dependencies&gt;
              &lt;!--Karate Dependencies  (This is creating a conflict) --&gt;
                  &lt;dependency&gt;
                      &lt;groupId&gt;com.intuit.karate&lt;/groupId&gt;
                      &lt;artifactId&gt;karate-apache&lt;/artifactId&gt;
                      &lt;version&gt;${karate.version}&lt;/version&gt;
                      &lt;scope&gt;test&lt;/scope&gt;
                  &lt;/dependency&gt;
                  &lt;dependency&gt;
                      &lt;groupId&gt;com.intuit.karate&lt;/groupId&gt;
                      &lt;artifactId&gt;karate-junit4&lt;/artifactId&gt;
                      &lt;version&gt;${karate.version}&lt;/version&gt;
                      &lt;scope&gt;test&lt;/scope&gt;
                  &lt;/dependency&gt;
              &lt;!--Karate Dependencies  (This is creating a conflict) --&gt;
              &lt;dependency&gt;
                  &lt;groupId&gt;info.cukes&lt;/groupId&gt;
                  &lt;artifactId&gt;cucumber-guice&lt;/artifactId&gt;
                  &lt;version&gt;${cucumber.version}&lt;/version&gt;
              &lt;/dependency&gt;
              &lt;!-- test dependencies --&gt;
              &lt;dependency&gt;
                  &lt;groupId&gt;info.cukes&lt;/groupId&gt;
                  &lt;artifactId&gt;cucumber-java&lt;/artifactId&gt;
                  &lt;version&gt;${cucumber.version}&lt;/version&gt;
                  &lt;scope&gt;test&lt;/scope&gt;
              &lt;/dependency&gt;
              &lt;dependency&gt;
                  &lt;groupId&gt;info.cukes&lt;/groupId&gt;
                  &lt;artifactId&gt;cucumber-junit&lt;/artifactId&gt;
                  &lt;version&gt;${cucumber.version}&lt;/version&gt;
                  &lt;scope&gt;test&lt;/scope&gt;
              &lt;/dependency&gt;
  &lt;!--Junit Dependeny  (This is creating a conflict with Karate) --&gt;
              &lt;dependency&gt;
                  &lt;groupId&gt;junit&lt;/groupId&gt;
                  &lt;artifactId&gt;junit&lt;/artifactId&gt;
                  &lt;version&gt;4.12&lt;/version&gt;
                  &lt;scope&gt;test&lt;/scope&gt;
              &lt;/dependency&gt;
  &lt;!--Junit Dependeny  (This is creating a conflict with Karate) --&gt;      
          &lt;/dependencies&gt;   
          &lt;profiles&gt;
              &lt;profile&gt;
                  &lt;id&gt;serial&lt;/id&gt;
                  &lt;activation&gt;
                      &lt;activeByDefault&gt;true&lt;/activeByDefault&gt;
                  &lt;/activation&gt;
                  &lt;properties&gt;
                      &lt;failsafe.fork.count&gt;1&lt;/failsafe.fork.count&gt;
                      &lt;classes&gt;**/AllTests.java&lt;/classes&gt;
                  &lt;/properties&gt;
              &lt;/profile&gt;
              &lt;profile&gt;
                  &lt;id&gt;parallel&lt;/id&gt;
                  &lt;properties&gt;
                      &lt;failsafe.fork.count&gt;4&lt;/failsafe.fork.count&gt;
                      &lt;classes&gt;**/*IT.java&lt;/classes&gt;
                  &lt;/properties&gt;
              &lt;/profile&gt;
          &lt;/profiles&gt;
      &lt;/project&gt;
  </code></pre>
  
  <p>Karate Runner File:</p>
  
  <pre><code>package com.test.automation.runner;
  
  import com.intuit.karate.KarateOptions;
  import com.intuit.karate.junit4.Karate;
  import org.junit.BeforeClass;
  import org.junit.runner.RunWith;
  
  @RunWith(Karate.class)
  @KarateOptions(features = "classpath:tests_stories/Test.feature")
      public class KarateApiRunner {
  
      @BeforeClass
      public static void before() {
          System.setProperty("karate.config", "src/configs/karate-config.js");
      }
      }
  </code></pre>
  
  <p>Cucumber Runner File:</p>
  
  <pre><code>package com.test.automation.runner;    
  
  import cucumber.api.CucumberOptions;
  import cucumber.api.junit.Cucumber;
  import org.junit.runner.RunWith;
  
  @RunWith(Cucumber.class)
  @CucumberOptions(
          glue = {"com.test.automation"},
          features = ".",
          plugin = {"pretty", "html:target/cucumber-report"},
          //  format = {"pretty", "json:target/cucumber-reports/cucumber.json"},
          tags = {"~@ignore","~@registration","@story"}
  )
  public class StoryRunner {
  }
  </code></pre>
  
  <p>Stack Trace when I try to run the StoryRunner Class :</p>
  
  <pre><code>java.lang.NoSuchMethodError: cucumber.api.CucumberOptions.snippets()Lcucumber/api/SnippetType;
  
      at cucumber.runtime.RuntimeOptionsFactory.addSnippets(RuntimeOptionsFactory.java:61)
      at cucumber.runtime.RuntimeOptionsFactory.buildArgsFromOptions(RuntimeOptionsFactory.java:40)
      at cucumber.runtime.RuntimeOptionsFactory.create(RuntimeOptionsFactory.java:24)
      at cucumber.api.junit.Cucumber.&lt;init&gt;(Cucumber.java:56)
      at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
      at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
      at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
      at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:500)
      at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:481)
      at org.junit.internal.builders.AnnotatedBuilder.buildRunner(AnnotatedBuilder.java:104)
      at org.junit.internal.builders.AnnotatedBuilder.runnerForClass(AnnotatedBuilder.java:86)
      at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:59)
      at org.junit.internal.builders.AllDefaultPossibilitiesBuilder.runnerForClass(AllDefaultPossibilitiesBuilder.java:26)
      at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:59)
      at org.junit.internal.requests.ClassRequest.getRunner(ClassRequest.java:33)
      at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:49)
      at com.intellij.rt.execution.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:47)
      at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:242)
      at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:70)
  
  
  Process finished with exit code -1
  </code></pre>
  
  <p>The Karate Class works as expected. I have tried various things like removing Junit Dependencies and running Cucumbers tests with Karate.class but none works. Please suggest if there is something I am missing.</p>