It is necessary to create a multi-mode maven project, consisting of a registration module and a main project. The problem is that it is not possible to use classes declared in different modules.
For example: I have ParentClaz in the parent src / main / java dir and ChildClaz in the child src / main / java directory. Itโs not possible right now to use either ParentClaz in ChildClaz , or vice versa.
The structure of the project is as follows:
+-- 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 the 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 to solve this problem?
source share