title: Cucumber-Jvm retry failed Scenarios
body: <p>I want to automatically retry failed tests to improve the reliability of my tests similar to the <strong>TestRule</strong> found within <strong>Junit</strong> I want the flexibility to insert logic around the tests so I can implement a retry loop:</p>
  
  <ul>
  <li><p>I’m using <strong>Cucumber-JVM</strong> and need a solution involving <strong>Java</strong> or <strong>Gradle</strong>  </p></li>
  <li><p>I have tried the following cucumber options via Gradle javaexec:</p>
  
  <p>//--format pretty --format rerun --out tmp/rerun.txt</p>
  
  <p>//--format rerun --out C:\Desktop\failed.txt</p></li>
  </ul>
  
  <p>Currently I am in the process of trying this via the RunCukesTest.java.</p>
  
  <pre><code>import cucumber.api.CucumberOptions;
  import cucumber.api.junit.Cucumber;
  import org.junit.runner.RunWith;
  
  
  /**
   *  String         dotcucumber 
      boolean dryRun 
      String[]    features 
      String[]    format 
      String[]    glue 
      boolean monochrome 
      String[]    name
      Specify a patternfilter for features or scenarios
      SnippetType snippets 
      boolean strict 
      String[]    tags 
   * 
   */
  
  
  @RunWith(Cucumber.class)
  @CucumberOptions(monochrome = true)
  public class RunCukesTest {
  }
  </code></pre>