How to create Multi Module Spring boot Project using dependency Management

We often need to create multi modules for a project under several reasons. Today Let see How to create Spring boot Multi module project to use <dependencyManagement> using Intellij  IDEA .

Normally when we create spring boot project(using project generate parent as Spring boot. but if spring boot project is child module we can’t point out the main pom as because it already have parent pom added. This is a one reason  we need to use Depedency Management in maven.

What is Dependency Management? Dependency Management allows to consolidate and centralize the management of dependency versions without adding dependencies which are inherited by all children. This is especially useful when you have a set of projects (i.e. more than one) that inherits a common parent. So we Can add Spring boot as Centralized  no need to add it as parent. Let’s see some actions.

First you need to create main pom as maven project.  Go to create New Project in Intellij and Select Maven from Left side. Then click next.

The Give any group id and artifact name in relevant fields like below.

On next window give a place to create the project and refactor name if necessary. Then click finish. Since we aren’t going to create anything in  main project folder we don’t need src folder in there. So delete it. After that open pom.xml

Then add


into the pom.xml like below

Now we need to add spring boot.

<!-- Import dependency management from Spring Boot -->

Now we need to child modules to the project.

Right click on main folder and New -> Module 

Then click next.  As you can see below the module already inherited from parent pom. You only need give the child module name 🙂

Next window you will ask place you want save the child module. Then click the Finish.

Now we have a child module. let’s enter Spring boot to the child module. Like below.



Now we need to add spring-boot-maven-plugin to the pom.xml


Now you are ready to use Spring boot on your child module. Create a spring boot application starter class

After that run below command in terminal (where child pom.xml is)

mvn spring-boot:run

If you type localhost:8080 on web browser and white label error in web browser that mean you child worked (of course errors because we didn’t configure the spring to return anything 😀 )

If you want full pom.xml files of modules check below.

  1. Parent Pom.xml
  2. Child Pom.xml