LearnAI ToolsCareerPractice BuildsPlayContact
Lesson 819 min read

Spring Boot Starters

Understand what a Spring Boot "starter" bundles together, and explore common starters like spring-boot-starter-web and spring-boot-starter-data-jpa.

Introduction

Before Spring Boot, one of the most tedious parts of setting up a new project was figuring out exactly which libraries you needed, and which versions of those libraries were actually compatible with each other. Spring Boot starters solve this problem entirely.

What is a Starter?

A starter is a single dependency you add to your build file that transitively pulls in a curated, pre-tested group of libraries needed for a specific kind of functionality. Instead of manually adding Tomcat, Jackson, Spring MVC, and validation libraries one by one (and hoping the versions are compatible), you add one dependency, `spring-boot-starter-web`, and get all of it at once, in versions guaranteed to work together.

The Naming Pattern

Official Spring Boot starters follow a consistent naming pattern: spring-boot-starter-*. Third-party starters (created by other library authors) typically follow the pattern *-spring-boot-starter instead.

Common Starters

StarterWhat It Bundles
spring-boot-starter-webEmbedded Tomcat, Spring MVC, Jackson for JSON, validation basics — everything for a REST API or web app.
spring-boot-starter-data-jpaSpring Data JPA, Hibernate, and the JDBC layer needed to talk to a relational database using entities and repositories.
spring-boot-starter-securitySpring Security, providing authentication and authorization out of the box.
spring-boot-starter-testJUnit 5, Mockito, AssertJ, and Spring Test — everything needed to write unit and integration tests.
spring-boot-starter-validationBean Validation (Jakarta Validation) support for annotations like @NotNull and @Size.
spring-boot-starter-actuatorProduction-ready features: health checks, metrics, and monitoring endpoints.

Adding a Starter

Adding a starter is as simple as declaring it in your build file. Here is a `pom.xml` that adds both the web starter and the JPA starter to build a REST API backed by a database.

pom.xml
<dependencies>
<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>com.h2database</groupId>
<artifactId>h2</artifactId>
<scope>runtime</scope>
</dependency>
</dependencies>

Notice that no version numbers are specified for the starters themselves — the Spring Boot parent POM (`spring-boot-starter-parent`) manages compatible versions for every official starter, so you only pin the Spring Boot version once, at the top of the file.

Common Mistakes

Avoid These Mistakes
  • Manually specifying a version number on an official starter, which can conflict with the version managed by the Spring Boot parent POM.
  • Adding both spring-boot-starter-web and a manually added, conflicting Tomcat or Jackson dependency at a different version.
  • Assuming a starter is a single library — it is a dependency-of-dependencies bundle, and inspecting it in your IDE will show many JARs pulled in.

Best Practices

  • Only add the starters you actually need — each one increases your application's JAR size and startup surface.
  • Let the Spring Boot parent POM (or dependency management import in Gradle) control starter versions.
  • Check the official Spring Boot documentation for the full, current list of starters before assuming you need a third-party one.

Frequently Asked Questions

Yes. Spring Boot supports building custom starters for reusable, shared functionality across multiple projects, following the same auto-configuration conventions.

Starters only add libraries to the classpath; auto-configuration still conditionally activates beans based on what you actually use and configure, so unused features generally stay dormant.

The spring-boot-starter-parent POM (or the equivalent Gradle BOM) manages consistent, tested version numbers for all official starters, so you only declare the Spring Boot version once.

Key Takeaways

  • A starter is a single dependency that transitively bundles a curated, pre-tested group of libraries.
  • Official starters follow the spring-boot-starter-* naming pattern.
  • spring-boot-starter-web and spring-boot-starter-data-jpa are two of the most commonly used starters.
  • The Spring Boot parent POM manages compatible version numbers so you rarely specify them yourself.

Summary

Starters turn dependency management from a manual, error-prone chore into a single line in your build file. Add spring-boot-starter-web, and you instantly have everything needed for a REST API, correctly versioned and ready to go. Next, you will learn how to configure your application using application.properties and application.yml.

Next Lesson →

application.properties & application.yml