I have 2 modules mod1 and mod2 from a same parent project. mod2 depends on mod1 and mod2 pom.xml includes the following dependancy
<dependency>
<groupId>com.project</groupId>
<artifactId>mod1</artifactId>
<version>${project.version}</version>
</dependency>
in mod1, I have defined in src/test/java
an abstract test class
public abstract class ServicesAbstractTest {
...
}
in mod2, src/test/java
I have defined a test class which inherits this one.
public class Mod2Test extends ServicesAbstractTest {
...
}
These are all Junit 4 tests. It works fine when I run the tests in Eclipse directly. But doesn't work when I do a mvn clean install
, there are compilation errors showing that maven doesnt find ServicesAbstractTest
when compiling and testing mod2.
I tried to apply what is said on similar questions : Pascal Thivent answer and Duncan Answer with 2 additional problems :
Strange
Could not find goal 'test-jar' in plugin org.apache.maven.plugins:maven-surefire-plugin:2.2 among available goals test -> [Help 1]
And more compilation problems for module 2 : I think I need here to specify additionnal scope, not only test, I am going to do further research on this one.