Monday, October 14, 2019

Spring Boot spring-boot-starter-parent

In the Spring Boot Hello World Web Application Example you would have seen that spring-boot-starter-parent has been added as a parent dependency in the pom.xml. In this post we’ll discuss this spring-boot-starter-parent dependency in detail.

Dependency management in Spring Boot

Each release of Spring Boot provides a curated list of dependencies that it supports. So, you don't need to provide version number for any of the required dependencies in your build configuration, as Spring Boot manages that for you. When you upgrade Spring Boot itself, these dependencies are upgraded as well in a consistent way.

The list is available as a standard BOM (Bills of Materials), dependency for it is spring-boot-dependencies that can be used with both Maven and Gradle.

spring-boot-starter-parent in Spring Boot

Spring Boot users using Maven as build tool can inherit from the spring-boot-starter-parent project to obtain sensible defaults. This parent dependency can be added in the pom.xml as given below-


spring-boot-starter-parent provides the following features-

  • Java 1.8 as the default compiler level. Note that Spring Boot 2.x requires Java 8 as the minimum Java version
  • UTF-8 source encoding.
  • A Dependency Management section which is inherited from the spring-boot-dependencies pom, that manages the versions of common dependencies. This dependency management lets you omit <version> tags for those dependencies when used in your own pom.
  • An execution of the repackage goal (spring-boot:repackage) with a repackage execution id.
  • Sensible resource filtering.

spring-boot-starter-parent pom

If you look at the pom.xml of spring-boot-starter-parent (Available here) you will see that it inherits from spring-boot-dependencies itself. In the properties section you can also see the configuration for Java version and UTF encoding.

Relevant section of the pom.xml is shown here.

<project xmlns="" xmlns:xsi=""
  <name>Spring Boot Starter Parent</name>
  <description>Parent pom providing dependency and plugin management for applications
      built with Maven</description>
    <resource.delimiter>@</resource.delimiter> <!-- delimiter that doesn't clash with Spring ${} placeholders -->

The curated list of dependencies is configured in spring-boot-dependencies. You can see its pom.xml here

Compatible dependencies are enclosed with in the properties tag.

    <!-- Dependency versions -->

Using Spring Boot without the Parent POM

If you do not want to use the spring-boot-starter-parent, you can still keep the benefit of the dependency management (but not the plugin management) by using a scope=import dependency, as follows-

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

Customizing managed versions

To customize a managed version you set its corresponding property. For example, to customize the version of Jersey which is controlled by the jersey.version property:


Then add dependency-


That's all for this topic Spring Boot spring-boot-starter-parent. If you have any doubt or any suggestions to make please drop a comment. Thanks!

>>>Return to Spring Tutorial Page

Related Topics

  1. Spring Boot Spring Initializr
  2. Spring Boot StandAlone (Console Based) Application Example
  3. Spring MVC @RequestParam Annotation Example
  4. Spring MVC Pagination Example Using PagedListHolder
  5. How to Read Properties File in Spring Framework

You may also like-

  1. Spring util-namespace Example For Wiring Collection
  2. Spring Asynchronous Method Execution Support Using @Async Annotation
  3. @Required Annotation in Spring Framework
  4. Spring JdbcTemplate Insert, Update And Delete Example
  5. Buffered Streams in Java IO
  6. Switch Expressions in Java 12
  7. Creating Temporary File in Java
  8. Java String Interview Questions And Answers