如何从Maven重新运行失败的黄瓜场景?

如何从Maven重新运行失败的黄瓜场景?,maven,cucumber,testng,Maven,Cucumber,Testng,我正在尝试重新运行失败的黄瓜测试。我在我的框架中使用maven和TestNG。我怎样才能做到这一点 我用2在POM中尝试了maven surefire插件(版本:3.0.0-M3)。但这不会在测试失败时自动重新运行测试 POM片段 <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-plugin</artifactId> <

我正在尝试重新运行失败的黄瓜测试。我在我的框架中使用maven和TestNG。我怎样才能做到这一点

我用
2
在POM中尝试了maven surefire插件(版本:3.0.0-M3)。但这不会在测试失败时自动重新运行测试

POM片段

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.0.0-M3</version>
<configuration>
<!-- <suiteXmlFiles>testNG.xml</suiteXmlFiles> -->
<classpathScope>test</classpathScope>
<skipTests>false</skipTests>
<!-- <testFailureIgnore>true</testFailureIgnore> -->
<testSourceDirectory>/src/test/java/testRunners</testSourceDirectory>
<useTestNG>false</useTestNG>
<rerunFailingTestsCount>2</rerunFailingTestsCount>  
</configuration>
</plugin>
我希望失败的测试会自动重新运行。但目前未通过的测试不会重新运行。

根据Maven指南 此功能仅支持JUnit 4.x(不支持TestNG)

2.21.0以来,提供商surefire-junit47可以重新运行由jvm 2.0.0及更高版本创建的场景

来源:

@RunWith(Cucumber.class)
@CucumberOptions(
features = "src/test/java/features",
glue= {"stepDefinitions"},  
tags= {"@licensing01"},
dryRun = false,
plugin = {"com.cucumber.listener.ExtentCucumberFormatter:TestExecutionReports/TestResults.html"
+ ",rerun:TestExecutionReports/failed_scenarios.txt"
+ ",json:target/cucumber.json"},
monochrome = true
)

public class TestRunnerBAU extends AbstractTestNGCucumberTests{
}