Home > Software engineering >  can not resolve junit from parent
can not resolve junit from parent

Time:03-09

I have parent project and 4 children modules. I have added junit dependency in parent like this:

<dependencys>
<dependency>
    <groupId>junit</groupId>
    <artifactId>junit</artifactId>
    <version>4.12</version>
    <scope>test</scope>
</dependency>
</dependencys>

Now I am testing some java classes in childreen modules and I get error messsage in eclipse:

The import org.junit cannot be resolved

Do I have to add junit dependency to all children modules or what is the best practice? enter image description here

CodePudding user response:

move junit dependency from dependencyManagement to dependencies should solve the problem

  • Related