У меня есть проект Maven, подобный этому:
Я хочу вызвать дочерний класс, который находится в дочернем модуле из родительского модуля.
Это мои poms:
Parent:
<modelVersion>4.0.0</modelVersion>
<groupId>com.test.test.test</groupId>
<artifactId>parent</artifactId>
<version>1.0-SNAPSHOT</version>
<name>parent</name>
<packaging>pom</packaging>
<modules>
<module>child-module</module>
</modules>
Child:
<modelVersion>4.0.0</modelVersion>
<groupId>com.test.test.child</groupId>
<artifactId>child-module</artifactId>
<name>child-module/name>
<parent>
<groupId>com.test.test.test</groupId>
<artifactId>parent</artifactId>
<version>1.0-SNAPSHOT</version>
</parent>
<dependencies>
<dependency>
<groupId>com.test.test.test</groupId>
<artifactId>parent</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
</dependencies>
Я пытался вызвать дочерний класс из родительского класса.
public class ParentClass {
@Test
public void test1() {
Child child = new Child ();
}
}