Home > Mobile >  Adding junit maven dependency giving error at cucumber runner file
Adding junit maven dependency giving error at cucumber runner file

Time:10-12

Adding below Junit dependency in maven pom.xml file do not show any cucumberrunner.java file

But once i add scope like below
    <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <version>4.12</version>
        **<scope>test</scope>** 
    </dependency>
it starts giving error in cucumberrunner.java file 
[![enter code here][1]][1]

enter image description here

enter image description here

CodePudding user response:

Cucumber framework is adding JUnit as transitive dependency and this is probably making some conflicts with it. Why do you want to add JUnit 4.12 as a separate dependency?

CodePudding user response:

By adding scope test you're only putting JUnit on the classpath when executing from src/test. I guess your runner class is in src/main.

  • Related