Reputation: 4384
I have a multi module Maven project that share a common parent pom. Some of these modules will use Spring Boot but some will not. I don't want to use Spring Boot as the parent of MY parent pom and have unnecessary dependencies in modules that don't use them.
What are the consequences of not using the Spring Boot parent pom? Will everything still work with all the auto configured goodness? I am considering the following solution of putting this in my parent pom as an alternative
<dependencyManagement>
<dependencies>
<dependency>
<!-- Import dependency management from Spring Boot -->
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-dependencies</artifactId>
<version>1.4.1.RELEASE</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
But I am pretty new to all this Maven stuff and Spring Boot so I don't want any unintended consequences or to declaw the capabilities of Spring Boot in any way. Can someone explain what (if anything) I will lose out on if I do this? Thanks!
Upvotes: 5
Views: 2172
Reputation: 10531
The Reference Guide explains how to use Spring Boot without the spring-boot-starter-parent
and what will happen. This answer also explains the difference between spring-boot-starter-parent
and spring-boot-dependencies
.
Summary: With both ways you get the powerful dependency management of all Spring Boot components and third party libraries. The spring-boot-starter-parent
also configures some Maven plugins like spring-boot-maven-plugin
for running mvn spring-boot:run
.
Upvotes: 3