Closed n524922 closed 1 year ago
Describe the bug When I run this test:
@RunWith(Cucumber.class) @CucumberOptions(plugin = { "pretty", "com.epam.reportportal.cucumber.StepReporter" }) public class RunTests { }
I get the following error:
java.lang.NoSuchMethodError: 'java.util.Optional io.cucumber.core.gherkin.FeatureParser.parse(java.net.URI, java.io.InputStream, java.util.function.Supplier)'
The reason seems to be the transitive dependency of io.cucumber:cucumber-gherkin that comes into conflict with jdi-dark-bdd and overrides it. Here's the relevant output from mvn dependency:tree:
io.cucumber:cucumber-gherkin
jdi-dark-bdd
mvn dependency:tree
[INFO] +- com.epam.reportportal:agent-java-cucumber6:jar:5.1.3:compile ... [INFO] | +- io.cucumber:cucumber-gherkin:jar:7.3.4:compile [INFO] | | \- io.cucumber:cucumber-plugin:jar:7.3.4:compile ...
and:
[INFO] +- com.epam.jdi:jdi-dark-bdd:jar:1.1.13:compile [INFO] | +- com.epam.jdi:jdi-dark:jar:1.1.13:compile ... [INFO] | +- io.cucumber:cucumber-java:jar:7.10.1:compile [INFO] | +- io.cucumber:gherkin:jar:26.0.2:compile [INFO] | | \- io.cucumber:messages:jar:19.1.4:compile (version selected from constraint [19.1.4,22.0.0)) ...
Steps to Reproduce Steps to reproduce the behavior:
com.epam.jdi:jdi-dark-bdd
com.epam.reportportal:agent-java-cucumber6
7.10.1
Expected behavior The test should launch.
Actual behavior The test does not launch and the execution ends with NoSuchMethodError.
NoSuchMethodError
Dependency versions Included above.
Additional context I was able to solve the issue by excluding the transitive dependency like this:
<dependency> <groupId>com.epam.reportportal</groupId> <artifactId>agent-java-cucumber6</artifactId> <version>5.1.3</version> <exclusions> <exclusion> <groupId>io.cucumber</groupId> <artifactId>cucumber-gherkin</artifactId> </exclusion> </exclusions> </dependency>
@n524922 Dependency conflicts are usually user's area of responsibility.
Describe the bug When I run this test:
I get the following error:
The reason seems to be the transitive dependency of
io.cucumber:cucumber-gherkin
that comes into conflict withjdi-dark-bdd
and overrides it. Here's the relevant output frommvn dependency:tree
:and:
Steps to Reproduce Steps to reproduce the behavior:
com.epam.jdi:jdi-dark-bdd
andcom.epam.reportportal:agent-java-cucumber6
with cucumber version >=7.10.1
Expected behavior The test should launch.
Actual behavior The test does not launch and the execution ends with
NoSuchMethodError
.Dependency versions Included above.
Additional context I was able to solve the issue by excluding the transitive dependency like this: