I have multimodule structured maven project as follow:
- parent
- server
- shared
- client
For me it is obvious that I would write unit test for all of those projects. So I thought that will be enought to add dependency to parent's pom.xml as follow:
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>
and then in each submodule use it, f.e.:
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
but I am getting errors in Eclipse like: The import org.junit cannot be resolved
When I do Maven-> Update project, or mvn clean install
, there are no errors at all.
I refer to the parent module in a children one as follow:
<parent>
<groupId>pl.daniel.erp</groupId>
<artifactId>erp</artifactId>
<version>0.0.1-SNAPSHOT</version>
</parent>
Please help