2
votes

I read a lot of posts regarding the ways to use spring-boot-starter-parent in a spring boot project. Essentially, I read posts (Spring documentation also talks about this) describing two ways to do this

  1. To use spring-boot-starter-parent as the project parent directly. It gives us the benefits of having the dependency management as well as the plugin management.
  2. The other way is to import the spring-boot-starter parent in the project pom (we may need this in case we already have a parent pom for the project). It allows us to get the benefits of dependency management but not the plugin management)

I am creating a new Maven multi module project. Ideally I would like to have my own custom parent and also get all the benefits of using the Spring-boot-starter-parent. I was wondering if it made sense to create a custom parent for my maven projects. This parent would in turn be a child of the spring-boot-starter-parent. If I am not missing anything, this way I could get the benefits of having the dependency management and plugin management from spring-boot-starter-parent and at the same time have a custom parent for all my projects where I could define some other common dependencies or if needed override the dependencies defined in the spring-boot-starter-parent which would then be inherited by all my projects. Does this design make sense or am I missing something. What are the drawbacks of this approach?

1

1 Answers

1
votes

There are no drawbacks -- this is exactly what you're meant to do if you want a multimodule spring-boot project. However, consider this: typically multi-module projects have all modules versioned together, released together, and dependant on each other. This rarely makes sense in a group of spring-boot modules, which are typically of the micro-service style and which require independent evolution. So, you should question your need for a multi-module project at all.