Need to create a multi module maven project which consist of a registration module and main project. The problem is that it's impossible to use classes declared in different modules.
e.g.: I have a ParentClaz
in my parent's src/main/java dir and ChildClaz
in child's src/main/java dir. Right now it's not possible to use neither ParentClaz
in ChildClaz
nor vice versa.
The project's structure looks like this:
+-- AdminPortal <- parent root
+-- registration <- child root
-- pom.xml <- child pom
-- pom.xml <- parent pom
my AdminPortal POM:
<modelVersion>4.0.0</modelVersion>
<groupId>com.example</groupId>
<artifactId>AdminPortal</artifactId>
<packaging>pom</packaging>
<version>1.0-SNAPSHOT</version>
<name>AdminPortal</name>
<url>http://maven.apache.org</url>
<modules>
<module>registration</module>
</modules>
Here's child POM:
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.example</groupId>
<artifactId>AdminPortal</artifactId>
<version>1.0-SNAPSHOT</version>
</parent>
<groupId>com.example.AdminPortal</groupId>
<artifactId>registration</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>war</packaging>
<name>registration</name>
<url>http://maven.apache.org</url>
How can this problem be solved?