Skip to main content

How to create a Maven multi-module project in IntelliJ

When growing no of code lines or developers, increase the software complexity also. Sometimes it’s very difficult to identify the given class responsibility. If we will be able to modularization the project. It’ll be decreased the complexity.


  1. Java
  2. Maven
  3. IntelliJ IDEA (my version is 15)


1. Create a new project.

2. Select “Maven”.

new project


3. Insert “GroupId” and “ArtifcatId”.

new project


4. Then give a project name.

new project


5. Now your project looks like this.



6. pom.xml


7. Now, we’re going to add the module. Here is the guide for maven module naming convention. We can divide modules based on responsibilities such as security, core service, api, ui etc.

add module


8. Let say, we need to add “core” module.

add module


9. Give module name.

add module


10. After adding no of modules. It looks like this.



Now almost done. We’re going to add a dummy class.

11.  Click on the “core” module.



12. We have to mark as a “Source root“.

mark as source root


13. Then add following package ( and Java class (

14. Now we’re going to use “core” service in the “api” module. Create a package ( in the “api” module. Add a java class (APIService.class).

15. After that, we need to add “core” module into the “api” module. Open the pom.xml that related to “api” module. Add the “core” dependecy.

16. Then rebuild the whole project.

build the project


17. Then call core services inside api module.

GitHub:- maven-multi-module-source-code

6585total visits,11visits today

Follow by Email