title: cucumber/runner/TimeServiceEventBus cucumber testng implementation
body: <p>I want to run cucumber using testng to get more control over my test. However I am getting this error while running it... how to fix this and get my test running... please advise... also unable to run extent report by using extentreportformatter stuck from everywhere.. please help to resolve this:</p>
  
  <pre><code>    java.lang.NoClassDefFoundError: cucumber/runner/TimeServiceEventBus
  
      at com.syn.runner.FeatureRunnerTest.setUpClass(FeatureRunnerTest.java:50)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:497)
      at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:124)
      at org.testng.internal.MethodInvocationHelper.invokeMethodConsideringTimeout(MethodInvocationHelper.java:59)
      at org.testng.internal.Invoker.invokeConfigurationMethod(Invoker.java:458)
      at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:222)
      at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:142)
      at org.testng.internal.TestMethodWorker.invokeBeforeClassMethods(TestMethodWorker.java:168)
      at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:105)
      at org.testng.TestRunner.privateRun(TestRunner.java:648)
      at org.testng.TestRunner.run(TestRunner.java:505)
      at org.testng.SuiteRunner.runTest(SuiteRunner.java:455)
      at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:450)
      at org.testng.SuiteRunner.privateRun(SuiteRunner.java:415)
      at org.testng.SuiteRunner.run(SuiteRunner.java:364)
      at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
      at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:84)
      at org.testng.TestNG.runSuitesSequentially(TestNG.java:1208)
      at org.testng.TestNG.runSuitesLocally(TestNG.java:1137)
      at org.testng.TestNG.runSuites(TestNG.java:1049)
      at org.testng.TestNG.run(TestNG.java:1017)
      at org.testng.IDEARemoteTestNG.run(IDEARemoteTestNG.java:72)
      at org.testng.RemoteTestNGStarter.main(RemoteTestNGStarter.java:123)
      Caused by: java.lang.ClassNotFoundException:cucumber.runner.TimeServiceEventBus
      at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
      at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
      ... 26 more
  </code></pre>
  
  <p>Pom </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
  
      &lt;groupId&gt;SynAutomationFramework&lt;/groupId&gt;
      &lt;artifactId&gt;SynAutomationFramework&lt;/artifactId&gt;
      &lt;version&gt;1.0-SNAPSHOT&lt;/version&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;configuration&gt;
                      &lt;source&gt;8&lt;/source&gt;
                      &lt;target&gt;8&lt;/target&gt;
                  &lt;/configuration&gt;
              &lt;/plugin&gt;
          &lt;/plugins&gt;
      &lt;/build&gt;
  
      &lt;dependencies&gt;
          &lt;!-- https://mvnrepository.com/artifact/org.seleniumhq.selenium/selenium-java --&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.14.0&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;!-- https://mvnrepository.com/artifact/io.cucumber/cucumber-core --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;io.cucumber&lt;/groupId&gt;
              &lt;artifactId&gt;cucumber-core&lt;/artifactId&gt;
              &lt;version&gt;3.0.2&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;!-- https://mvnrepository.com/artifact/io.cucumber/cucumber-java --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;io.cucumber&lt;/groupId&gt;
              &lt;artifactId&gt;cucumber-java&lt;/artifactId&gt;
              &lt;version&gt;3.0.2&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;!-- https://mvnrepository.com/artifact/io.cucumber/cucumber-junit --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;io.cucumber&lt;/groupId&gt;
              &lt;artifactId&gt;cucumber-junit&lt;/artifactId&gt;
              &lt;version&gt;3.0.0&lt;/version&gt;
              &lt;scope&gt;test&lt;/scope&gt;
          &lt;/dependency&gt;
          &lt;!-- https://mvnrepository.com/artifact/io.cucumber/cucumber-jvm-deps --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;io.cucumber&lt;/groupId&gt;
              &lt;artifactId&gt;cucumber-jvm-deps&lt;/artifactId&gt;
              &lt;version&gt;1.0.6&lt;/version&gt;
              &lt;scope&gt;provided&lt;/scope&gt;
          &lt;/dependency&gt;
          &lt;!-- https://mvnrepository.com/artifact/junit/junit --&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;!-- https://mvnrepository.com/artifact/org.mockito/mockito-all --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.mockito&lt;/groupId&gt;
              &lt;artifactId&gt;mockito-all&lt;/artifactId&gt;
              &lt;version&gt;1.10.19&lt;/version&gt;
              &lt;scope&gt;test&lt;/scope&gt;
          &lt;/dependency&gt;
          &lt;!-- https://mvnrepository.com/artifact/io.cucumber/gherkin--&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;io.cucumber&lt;/groupId&gt;
              &lt;artifactId&gt;gherkin&lt;/artifactId&gt;
              &lt;version&gt;5.0.0&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;!-- https://mvnrepository.com/artifact/com.aventstack/extentreports --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;com.aventstack&lt;/groupId&gt;
              &lt;artifactId&gt;extentreports&lt;/artifactId&gt;
              &lt;version&gt;3.1.5&lt;/version&gt;
              &lt;scope&gt;provided&lt;/scope&gt;
          &lt;/dependency&gt;
          &lt;!-- https://mvnrepository.com/artifact/com.vimalselvam/cucumber-extentsreport --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;com.vimalselvam&lt;/groupId&gt;
              &lt;artifactId&gt;cucumber-extentsreport&lt;/artifactId&gt;
              &lt;version&gt;3.1.1&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;!-- https://mvnrepository.com/artifact/org.testng/testng --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.testng&lt;/groupId&gt;
              &lt;artifactId&gt;testng&lt;/artifactId&gt;
              &lt;version&gt;6.14.3&lt;/version&gt;
              &lt;scope&gt;test&lt;/scope&gt;
          &lt;/dependency&gt;
          &lt;!-- https://mvnrepository.com/artifact/net.masterthought/cucumber-reporting --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;net.masterthought&lt;/groupId&gt;
              &lt;artifactId&gt;cucumber-reporting&lt;/artifactId&gt;
              &lt;version&gt;4.0.0&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;!-- https://mvnrepository.com/artifact/io.cucumber/cucumber-testng --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;io.cucumber&lt;/groupId&gt;
              &lt;artifactId&gt;cucumber-testng&lt;/artifactId&gt;
              &lt;version&gt;4.0.1&lt;/version&gt;
          &lt;/dependency&gt;
  
      &lt;/dependencies&gt;
  &lt;/project&gt;
  </code></pre>
  
  <p>runner class</p>
  
  <pre><code>    import cucumber.api.CucumberOptions;
      import cucumber.api.testng.AbstractTestNGCucumberTests;
      import cucumber.api.testng.*;
      import org.testng.annotations.*;
      import cucumber.api.testng.TestNGCucumberRunner;
      import cucumber.api.testng.CucumberFeatureWrapper;
  
  
      //@RunWith(Cucumber.class)
  
      @CucumberOptions(  monochrome = true,
          features = "src/test/resources/features/",
          glue = {"steps"},
          plugin = {"pretty", "json:target/reports/jsonreports.json" }
      )
  
  
      public class FeatureRunnerTest extends AbstractTestNGCucumberTests{
       @AfterClass
      public static void afterSuite(){
  
          GenerateReport.generateReport();
  
          String path = System.getProperty("user.dir")+ "src\\target\\cucumber-html-reports\\overview-features.html";
          //String htmlpath = "&lt;a href=" + path + " alt='Path of the Test Report1'&gt;Path of the Test Report&lt;/a&gt;";
          System.out.println(path);
  
  }
  </code></pre>