Cucumber “线程中的异常”;“主要”;java.lang.NoSuchMethodError:gherkin.formatter.model.Scenario.getId()Ljava/lang/String;

Cucumber “线程中的异常”;“主要”;java.lang.NoSuchMethodError:gherkin.formatter.model.Scenario.getId()Ljava/lang/String;,cucumber,gherkin,Cucumber,Gherkin,我正在编写一个Cumber代码来自动比较xml文件。但是 线程“main”java.lang.NoSuchMethodError中出现异常:gherkin.formatter.model.Scenario.getId()Ljava/lang/String 当我运行功能文件时。我用的是小黄瓜2.12.2 我的功能文件 Feature: File Comparator Scenario Outline: Comparing XML Files Given I have <XML1>

我正在编写一个Cumber代码来自动比较xml文件。但是 线程“main”java.lang.NoSuchMethodError中出现异常:gherkin.formatter.model.Scenario.getId()Ljava/lang/String 当我运行功能文件时。我用的是小黄瓜2.12.2

我的功能文件

Feature: File Comparator

Scenario Outline: Comparing XML Files

Given I have <XML1> and <XML2> in <Location1> and <Location2>
When I compare <XML1> to <XML2>
Then Both should be the same
Exmaples:

| XML1| location1 | XML2 | location2|

| XML1.xml| C:/Filepath1| XML2.xml| C:/Filepath2|
我的跑步者

package cucumber;

import org.junit.runner.RunWith;
import cucumber.api.CucumberOptions;
import cucumber.api.junit.Cucumber;

@RunWith(Cucumber.class)
@CucumberOptions(

    format = {"pretty", "html:target/html/", "json:target/json/"},
    features = "src/features", 
    strict = true
    )
public class FCRunner {

}

你在某处引进了早期版本的小黄瓜。例如,在小黄瓜2.11.5中,这种方法在当时还不存在


检查您的依赖项。

您知道它到底在哪里失败吗?开始了吗?谢谢。我移除了罐子,添加了新的罐子,解决了这个问题。现在面临新的挑战。
package cucumber;

import org.junit.runner.RunWith;
import cucumber.api.CucumberOptions;
import cucumber.api.junit.Cucumber;

@RunWith(Cucumber.class)
@CucumberOptions(

    format = {"pretty", "html:target/html/", "json:target/json/"},
    features = "src/features", 
    strict = true
    )
public class FCRunner {

}