This is a basic question, I\'m just not really familiar with maven multi-module structures. Say, I have a web application. And I want to connect some modules to it (some ser
If you have a multi-module project you need a structure like the following which will also be represented by the folder structure as well.
+-- root (pom.xml)
+--- module-1
+--- module-2
+--- module-war
Whereas the root module contains a thing like this:
com.test.project
parent
1.0-SNAPSHOT
module-1
module-2
module-war
In the module-1 your pom should look like this:
com.test.project
parent
1.0-SNAPSHOT
module-1
dependencies for the module
in module-2 it look more or less the same..and in the war module it looks like:
com.test.project
parent
1.0-SNAPSHOT
war
module-war
dependencies for the module
If you have dependencies between the modules for example module-1 depends on module-2 it looks like the following in module-1:
com.test.project
parent
1.0-SNAPSHOT
module-1
${project.groupId}
module-2
{project.version}
..other dependencies..
To build and package your project you will go to parent folder and do simply a
mvn clean package