Little bird
Little bird

Reputation: 1088

Adding junit maven dependency giving error at cucumber runner file

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

Upvotes: 0

Views: 225

Answers (2)

M.P. Korstanje
M.P. Korstanje

Reputation: 12059

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.

Upvotes: 1

Alex Karamfilov
Alex Karamfilov

Reputation: 674

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?

Upvotes: 0

Related Questions