On this page
Spring Boot Starters
Starters are dependency descriptors that bundle commonly used libraries. Add one starter dependency and get a working, auto-configured setup.
Popular Starters
| Starter | Includes |
|---|---|
spring-boot-starter-web |
Spring MVC, Tomcat, Jackson |
spring-boot-starter-data-jpa |
Hibernate, Spring Data JPA |
spring-boot-starter-security |
Spring Security |
spring-boot-starter-test |
JUnit 5, Mockito, AssertJ |
spring-boot-starter-actuator |
Production monitoring |
spring-boot-starter-validation |
Bean Validation (Hibernate Validator) |
spring-boot-starter-data-redis |
Lettuce, Spring Data Redis |
Maven Example
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
<scope>runtime</scope>
</dependency>
Gradle Example
dependencies {
implementation("org.springframework.boot:spring-boot-starter-web")
implementation("org.springframework.boot:spring-boot-starter-data-jpa")
runtimeOnly("org.postgresql:postgresql")
}
Parent POM / BOM
Spring Boot manages dependency versions via BOM:
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>3.2.0</version>
</parent>
Or import BOM without parent:
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-dependencies</artifactId>
<version>3.2.0</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
Creating a Custom Starter
Structure:
my-spring-boot-starter/
├── src/main/java/.../autoconfigure/
│ ├── MyAutoConfiguration.java
│ └── MyProperties.java
└── src/main/resources/META-INF/spring/
└── org.springframework.boot.autoconfigure.AutoConfiguration.imports
Naming convention: {feature}-spring-boot-starter (official) or my-{feature}-starter (custom).
Best Practices
- Use starters instead of declaring individual transitive dependencies
- Do not specify versions for dependencies managed by Spring Boot BOM
- Exclude unwanted transitive dependencies when needed
- Create custom starters for shared internal libraries across projects