Every Spring Boot version comes with a curated list of dependencies that it supports. These dependencies are upgraded when we upgrade the version of Spring Boot. Since these dependencies are kind of predefined and come with Spring Boot, we do not have to provide the version of dependencies in build configuration.
It is not compulsory to use the same version of dependencies as recommended by Spring Boot. We can specify version of our dependencies, if it is required. Every Spring Boot version is associated with a base version of Spring Framework. It is highly recommended that you do not specify the version.
This curated list of dependencies which comes with every version of Spring Boot has the following:
- All required Spring Boot modules
- A list of third party libraries
Starter dependencies in Spring Boot
Starters are a set of convenient dependency descriptors. Let us understand what this statement means with an example. The starter spring-boot-starter-web
contains all the required dependencies to bootstrap a web application. So all Spring and other required dependencies (with the transitive dependencies) are taken care by the Spring Boot when we specify this starter in our pom.xml
. This helps us to get started quickly as we do not have to manually specify the dependencies with their correct versions.
Following are few important and commonly used application starters. These are provided by Spring Boot under the org.springframework.boot
group.
spring-boot-starter | Core starter, includes support for auto-configuration, logging and YAML |
spring-boot-starter-aop | Starter for aspect-oriented programming with Spring AOP and AspectJ |
spring-boot-starter-batch | Starter for using Spring Batch |
spring-boot-starter-data-jdbc | Starter for using Spring Data JDBC |
spring-boot-starter-data-jpa | Starter for using Spring Data JPA with Hibernate |
spring-boot-starter-data-ldap | Starter for using Spring Data LDAP |
spring-boot-starter-data-rest | Starter for exposing Spring Data repositories over REST using Spring Data REST |
spring-boot-starter-jdbc | Starter for using JDBC with the HikariCP connection pool |
spring-boot-starter-json | Starter for working with json |
spring-boot-starter-test | Starter for testing Spring Boot applications with libraries including JUnit Jupiter, Hamcrest and Mockito |
spring-boot-starter-web | Starter for building web, including RESTful, applications using Spring MVC |
spring-boot-starter-actuator | Starter for using Spring Boot’s Actuator which provides production ready features to help you monitor and manage your application |
Note
All official starters follow naming pattern like spring-boot-starter-*
, where * is type of application. Third party starters should not start with spring-boot, as it is reserved for official Spring Boot artifacts.