Spring Boot – Dependency Management
Last Updated :
17 Mar, 2025
Spring Boot framework is the most popular web development framework. No doubt, it provides an abundance of essential features and a convenient way to handle those features. At the heart of Spring Boot is the ‘Dependency Management‘ feature.
Importance of Dependency Management
- Centralized Dependency Management: All dependencies are managed in one place, typically in the pom.xml (for Maven) or build.gradle (for Gradle) file.
- Automatic Version Management: When we change the Spring Boot version, the versions of all related dependencies are automatically updated.
- Conflict Prevention: It helps prevent version conflicts between different libraries, especially in multi-module projects.
Note: Dependency Management is just a way of managing all the required dependencies in one place and efficiently making use of them.
Life Cycle of Dependency Management
The below diagram demonstrates the type of Dependency Management

Working of Dependency Management in Spring-Boot
- Dependency is nothing but a ‘Library’ that provides specific functionality that we can use in our application.
- In Spring-Boot, Dependency Management and Auto-Configuration work simultaneously.
- It is the auto-configuration that makes managing dependencies supremely easy for us.
- We have to add the dependencies in the pom.xml/build.gradle file.
- These added dependencies will then get downloaded from Maven Central.
- The downloaded dependencies will get stored into the ‘.m2’ folder in the local file system.
- The Spring-Boot application can access these dependencies from ‘.m2’ and its sub-directories.
- Example -( .m2 -> repository -> org, etc )

Project Build Systems
- Spring Boot supports two main build system
- Maven: Dependencies are managed in the pom.xml file.
- Gradle: Dependencies are managed in the build.gradle file.
- Maven and Gradle use a different syntax for managing dependencies.
- Also, we don’t need to mention the version of the dependencies, as Spring-Boot configures them automatically. Though we can mention the version or override as well.
- The curated list published contains all the Spring Modules and third-party libraries that you can use with Spring-Boot.
Key features of Maven build
- It uses the default Java compiler.
- It has UTF-8 source encoding
- A useful feature of not mentioning the version information of dependencies is inherited from POM ( spring-boot-dependencies ).
- Resource filtering and plugin configurations.
- Resource filtering is also for ‘application.properties’ and ‘application.yml’.
Spring-Boot Starters
Working with dependency management, Spring-Boot Starters plays an important role here. They are a set of convenient dependency descriptors that one should mention in your application. You can get access to all Spring and related tech stacks that you require for the project. A starter has a similar naming pattern – ( spring-boot-starter-* ). Third-party starters do not start with ‘spring-boot’. Star in starter pattern takes place of any technology name to be used.
Example: ‘spring-boot-starter-jdbc’
Types of Starters
- Application Starters: For building specific types of applications (e.g., spring-boot-starter-web).
- Technical Starters: For technical features like logging or security (e.g., spring-boot-starter-security).
- Production-ready Starters: For monitoring and managing production applications (e.g., spring-boot-starter-actuator).
All the required dependencies of Spring-Boot are embedded in the ‘dependencies’ tag/block.
Maven -> pom.xml
<dependencies>
<dependency>
<groupId> … </groupId>
<artifactId> … </artifactId>
<version> … </version>
</dependency>
</dependencies>
Adding Dependencies in Spring Boot
1. Using Maven (pom.xml)
In STS, create a Spring Boot project by selecting File > New > Spring Starter Project, adding required dependencies, and clicking Finish

To add the dependency for the current working project:
- Right-click on project
- Select Spring -> Add Starters
- Search for the required dependencies and add them
- Next
- Select pom.xml/HELP.md or both
- Finish

If we know the dependency, we can directly place them in the pom.xml file. For example to add the Thymeleaf template engine in your project build, one can add the following dependency in the ‘<dependencies></dependencies>‘ tag.
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-thymeleaf</artifactId>
</dependency>
pom.xml:
XML
<?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>3.4.3</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>sia</groupId>
<artifactId>GFG</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>GFG</name>
<description>GFG Application</description>
<properties>
<java.version>17</java.version>
</properties>
<dependencies>
<!-- Spring Boot Starter Web for building web applications -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<!-- Spring Boot Starter Thymeleaf for rendering views -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-thymeleaf</artifactId>
</dependency>
<!-- Lombok for reducing boilerplate code -->
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<optional>true</optional>
</dependency>
<!-- Spring Boot Starter Test for unit testing -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<!-- Spring Boot DevTools for enhanced development experience -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<scope>runtime</scope>
<optional>true</optional>
</dependency>
</dependencies>
<build>
<plugins>
<!-- Spring Boot Maven Plugin for packaging the application -->
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<excludes>
<!-- Exclude Lombok from the packaged application -->
<exclude>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
</exclude>
</excludes>
</configuration>
</plugin>
</plugins>
</build>
</project>
Understanding/Configuring Dependencies
Starter Parent
To take advantage of auto-configured ‘sensible’ defaults, we should add Starter Parent in the project.
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>___</version>
</parent>
With default configuration like above, we can override respective dependencies by overriding a ‘property’.
<properties>
<slf4j.version>___</slf4j.version>
</properties>
This will make sure that the mentioned version of a SLF4j library will be used.
We can also manage auto-configured ‘Starter Parent‘ and create a custom POM without the need to specify the first one with the help of artifact ‘scope=import’ of ‘spring-boot-dependencies.
XML
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-dependencies</artifactId>
<version>___</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
After this, we can normally add the dependencies like the one mentioned above. But, to override the individual dependency, we need to add a respective entry before the ‘spring-boot-dependencies’ entry.
XML
<dependencyManagement>
<dependencies>
<!-- Override SLF4J provided by Spring Boot -->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>___</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-dependencies</artifactId>
<version>___</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
But, we have to manually configure the plugin management by adding ‘spring-boot-maven-plugin’ explicitly. Managing the Maven plug-in is very essential as it packs the Spring-Boot application into an executable jar.
Maven -> pom.xml
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
Java Version
We can also change the java version in the following:
<properties>
<java.version>___</java.version>
</properties>
Developer Tools
A set of specific tools to make the application development process much easier. It is in the ‘spring-boot-devtools’ module.
Maven -> pom.xml
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<optional>true</optional>
</dependency>
2. Using Gradle
In the case of a ‘Starter Parent’ like in Maven, here there is no ‘Super Parent’ to take advantage of some auto configurations. To add dependencies in Gradle, add them in the ‘dependencies{ }’ section. For providing executable jar, we can add the following in the dependencies section
‘spring-boot-gradle-plugin’
build.gradle:
buildscript {
repositories {
mavenCentral() // Use Maven Central instead of jcenter (jcenter is deprecated)
}
dependencies {
classpath(“org.springframework.boot:spring-boot-gradle-plugin:3.4.4”)
}
}
apply plugin: ‘java’
apply plugin: ‘org.springframework.boot’
repositories {
mavenCentral() // Use Maven Central for dependencies
}
dependencies {
implementation(“org.springframework.boot:spring-boot-starter-web”)
testImplementation(“org.springframework.boot:spring-boot-starter-test”)
}
For adding the ‘Developer tools‘, add the following in the ‘dependencies’ block
Gradle -> build.gradle
developmentOnly(“org.springframework.boot:spring-boot-devtools”)
Note: Each release of Spring Boot is associated with a base version of the Spring Framework, so it is highly recommended to not specify its version on your own.
Similar Reads
Spring Boot - Project Deployment Using Tomcat
Spring Boot is a microservice-based framework and making a production-ready application in it takes very little time. Spring Boot is built on the top of the spring and contains all the features of spring. And is becoming a favorite of developers these days because itâs a rapid production-ready envir
5 min read
Spring Boot - Difference Between AOP and OOP
AOP(Aspect-Oriented Programming) complements OOP by enabling modularity of cross-cutting concerns. The Key unit of Modularity(breaking of code into different modules) in Aspect-Oriented Programming is Aspect. one of the major advantages of AOP is that it allows developers to concentrate on business
3 min read
Spring Boot - Difference Between AOP and AspectJ
Spring Boot is built on the top of the spring and contains all the features of spring. And is becoming a favorite of developers these days because of its rapid production-ready environment which enables the developers to directly focus on the logic instead of struggling with the configuration and se
3 min read
Spring Boot - Logging
Logging in Spring Boot plays a vital role in Spring Boot applications for recording information, actions, and events within the app. It is also used for monitoring the performance of an application, understanding the behavior of the application, and recognizing the issues within the application. Spr
8 min read
Advantages of Spring Boot JDBC
Spring JDBC is used to build the Data Access Layer of enterprise applications, it enables developers to connect to the database and write SQL queries and update data to the relational database. The code related to the database has to be placed in DAO classes. SpringJDBC provides a class called JdbcT
3 min read
Spring Boot - Packaging
The Spring Framework was created to provide an open-source application framework to feature better infrastructure support for developing Java applications. It is one of the most popular Java Enterprise Edition (Java EE) frameworks, Spring framework helps developers in creating high-performing applic
11 min read
Spring Boot - JDBC
Spring Boot JDBC is used to connect the Spring Boot application with JDBC by providing libraries and starter dependencies. Spring Boot JDBC has a level of control over the SQL queries that are being written. Spring Boot JDBC has simplified the work of Spring JDBC by automating the work and steps by
8 min read
Spring Boot - AOP After Throwing Advice
Spring is widely used for creating scalable applications. For web applications Spring provides. Spring MVC is a widely used module of spring that is used to create scalable web applications. While Aspect-oriented programming(AOP) as the name suggests uses aspects in programming. It can be defined as
6 min read
Spring Boot - AOP After Returning Advice
Prerequisite: Aspect Oriented Programming and AOP in Spring Framework Aspect-oriented programming(AOP) as the name suggests uses aspects in programming. It can be defined as the breaking of code into different modules, also known as modularisation, where the aspect is the key unit of modularity. Asp
5 min read
Multi-Module Project With Spring Boot
Multi-Module project with Spring Boot refers to a project structure where multiple modules or subprojects are organized under a single parent project. Each module can represent a distinct component, functionality, or layer of the application, allowing for better organization, maintainability, and co
6 min read