The spring-boot-starter-parent is a Maven parent POM that supplies build defaults and dependency management for a Spring Boot application. It is not a starter dependency and does not add application libraries to the classpath. A Gradle project cannot inherit a Maven parent; it obtains Spring Boot dependency management through a Gradle plugin or the spring-boot-dependencies BOM.
The examples below use Spring Boot 4.1.2, the latest stable release at the time of writing.
1. Add the Parent to a Maven Application
Consider a small catalog service with one HTTP endpoint. Its build needs a web starter, a Java compiler setting, and a way to produce an executable JAR. The complete pom.xml below declares the Maven parent first. The parent supplies the version for the web starter and the default configuration for the Spring Boot Maven plugin; the project still declares both explicitly where it uses them.
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>4.1.2</version>
<relativePath/>
</parent>
<groupId>com.howtodoinjava</groupId>
<artifactId>boot-configuration-demo</artifactId>
<version>1.0.0</version>
<properties>
<java.version>17</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-webmvc</artifactId>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>
The empty relativePath tells Maven to resolve the parent from a repository instead of searching the local directory for a parent POM. The application uses spring-boot-starter-webmvc, the current web MVC starter, without a version because Spring Boot manages it. The spring-boot-maven-plugin packages the compiled application and its runtime dependencies into an executable JAR.
The java.version property sets the compiler target to Java 17. The parent already defaults to Java 17, so this explicit value documents the application’s minimum Java version. A different supported Java version can be selected by changing this property and building with a matching JDK.
2. See What the Parent Contributes
The parent inherits dependency management from spring-boot-dependencies. Dependency management selects versions; it does not add a dependency until the application declares that dependency. In the POM above, the web MVC starter is declared, so Maven resolves its version to 4.1.2. Without the spring-boot-starter-webmvc entry, inheriting the parent alone would not create a web application.
Build the project and inspect the resolved starter from its directory:
mvn package
mvn dependency:tree -Dincludes=org.springframework.boot:spring-boot-starter-webmvc
The relevant dependency-tree line is:
org.springframework.boot:spring-boot-starter-webmvc:jar:4.1.2:compile
This line shows the version Maven selected for a dependency that had no version in pom.xml. The parent also supplies Maven plugin management, UTF-8 source encoding, compiler parameter metadata, resource filtering, and a repackage execution for the Spring Boot plugin. These are build settings; they are separate from the libraries that the web starter puts on the runtime classpath. The Spring Boot Maven plugin reference lists the current defaults.
The accompanying sample exposes GET /catalog/status. After mvn package, run the JAR and request the endpoint:
java -jar target/boot-configuration-demo-1.0.0.jar
curl http://localhost:8080/catalog/status
Catalog ready
The response confirms that the starter supplied the web runtime and the Maven plugin produced a runnable archive. It does not mean that the parent itself contains the controller or web libraries.
3. Choose Parent, BOM, or Gradle Management
The right setup depends on the project’s build system and whether another Maven parent is already required.
| Project | Use | What it provides |
|---|---|---|
| Maven application without another parent | spring-boot-starter-parent | Managed dependencies and Maven build defaults. |
| Maven application with an existing parent | Import spring-boot-dependencies as a BOM | Managed dependency versions; configure plugins yourself. |
| Gradle application | Spring Boot Gradle plugin plus dependency management plugin or Gradle platform | Managed dependency versions through Gradle; no Maven parent inheritance. |
3.1. Maven with Another Parent
A Maven POM can have only one parent. If a company parent already controls the build, keep it and import Spring Boot’s BOM in dependencyManagement:
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-dependencies</artifactId>
<version>4.1.2</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
The BOM lets a declared Spring Boot dependency omit its version. It does not supply the starter parent’s Maven plugin defaults. In this arrangement, configure the Spring Boot Maven plugin and compiler settings in the project’s own POM or company parent. Spring Boot’s documentation also notes that overriding a managed version through a property in the child POM works differently with a BOM import than with parent inheritance.
3.2. Gradle
Gradle uses plugins and dependency constraints instead of a Maven parent. A comparable build.gradle starts like this:
plugins {
id 'java'
id 'org.springframework.boot' version '4.1.2'
id 'io.spring.dependency-management' version '1.1.7'
}
group = 'com.howtodoinjava'
version = '1.0.0'
java {
toolchain {
languageVersion = JavaLanguageVersion.of(17)
}
}
repositories {
mavenCentral()
}
dependencies {
implementation 'org.springframework.boot:spring-boot-starter-webmvc'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
}
With the dependency management plugin applied, the Spring Boot plugin imports the matching spring-boot-dependencies BOM. The starter declarations therefore omit versions. Gradle’s native platform support is another option; it uses Gradle constraints and does not require the dependency management plugin. The Spring Boot Gradle dependency-management reference explains both choices.
4. Override a Managed Version Carefully
The parent manages a compatible set of libraries. If a specific dependency must use a different version, declare that version on the dependency or override its managed property where the parent documents one. Check the effective result with mvn dependency:tree and run the application’s tests.
Do not override one Spring Boot starter to a different Boot release while leaving the rest on 4.1.2. Spring Boot tests its managed dependency set together, so an override needs a concrete compatibility reason. For an ordinary application, upgrading the Spring Boot version is usually the clearer way to upgrade its managed libraries together.
5. FAQs
5.1. Does the starter parent add every Spring Boot starter?
No. It manages versions for supported dependencies. The project still declares each starter it needs, such as spring-boot-starter-webmvc or spring-boot-starter-data-jpa. An undeclared starter is not added to the application classpath.
5.2. Is spring-boot-starter-parent a Gradle dependency?
No. It is a Maven parent POM. Use the Spring Boot Gradle plugin and one of Gradle’s supported dependency-management mechanisms instead.
5.3. Can I use a company Maven parent and Spring Boot’s managed versions?
Yes. Keep the company parent and import spring-boot-dependencies as a BOM. Then verify the compiler and plugin configuration, because BOM import does not provide the starter parent’s build defaults.
6. Conclusion
Use the starter parent for a Maven application that can inherit it. If another parent is required, import the Spring Boot BOM and configure the missing build defaults. Gradle projects use their own plugins and dependency-management mechanisms. In every case, declare the starters the application actually needs.
Happy Learning!
The complete runnable sample on GitHub contains the Maven build and catalog application.
Saying “…
spring-boot-starter-parentdependency which is used internally by all spring boot dependencies” is a bit misleading, as spring-boot libraries themselves don’t usespring-boot-starter-parent, they mostly usespring-boot-parentorspring-boot-startersas their parent.Also, strictly speaking, in Maven terminology, it’s not a “dependency”, it’s a “parent”. A trivial distinction for those familiar with it, but for newcomers it can be distracting.
Thanks for the feedback. I will update the post.
Is there a way to use spring-boot-starter-parent to manage only one module of a project, not the others(as they have been proved all working)?
above explanation your saying “spring-boot-starter-parent” is based and these two .xml file , from this two files we we get spring-boot-starter-parent libraries right