Spring Boot Starter: A Complete Guide

For those just starting out with Spring Boot, one of the first things that causes confusion is the “Starter.” You might have thought, “What is a Starter? Is it some magic box that includes everything I need?” You’d be half right! Spring Boot Starter is a very convenient mechanism that bundles together the dependencies needed for a specific feature. Let’s go through exactly what it is and how to use it, step by step.

Note that this article assumes Spring Boot 3.x (3.2 or later recommended). The Starter naming changes introduced in Spring Boot 4.x are covered later in this article, in the section “Target Version of This Article and Starter Name Changes.”

What Is Spring Boot Starter?

Spring Boot Starter was created to simplify the dependency declarations used by build tools like Maven and Gradle.

For example, when building a web application, you would normally need to list many dependencies individually in your pom.xml (Maven) or build.gradle (Gradle) — the Spring Web module, Servlet API, JSP, and so on. As a project grows, this management becomes cumbersome, and issues like version mismatches and dependency conflicts become more likely.

This is where Starters like spring-boot-starter-web come in. A Starter doesn’t point to a single library — it’s “a bundle of libraries commonly used together in Spring Boot applications.” Simply adding spring-boot-starter-web as a dependency pulls in all the libraries needed for Spring Web into your project.

Adding Dependencies with Spring Boot Starter

For example, in a Maven project, you would write the following in pom.xml:

<dependencies>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-web</artifactId>
    </dependency>
</dependencies>

For Gradle, the equivalent in build.gradle looks like this:

dependencies {
    implementation 'org.springframework.boot:spring-boot-starter-web'
}

With just this, major libraries needed for a web application — Spring MVC, Jackson (JSON processing), Tomcat (embedded server), and more — are automatically added.

Types of Spring Boot Starters

There is a huge variety of Starters available, covering functionality such as database access (spring-boot-starter-data-jpa, etc.), security (spring-boot-starter-security), testing (spring-boot-starter-test), and more. In addition to the official Spring Boot Starters, there are also community-made Starters (you should verify whether a community Starter is trustworthy).

By using Spring Initializr (https://start.spring.io/), you can easily generate a project skeleton by selecting the Starters you need.

Practical Rules for Choosing Starters Without Mistakes

Just because Starters are convenient doesn’t mean you should add too many — doing so can increase startup time and configuration complexity. In practice, keeping your initial dependencies minimal using the following rules tends to be more stable.

  • Start with a minimal configuration (e.g., web + actuator + test)
  • Add Starters you don’t yet have a concrete plan for later, as the need arises
  • Separate profiles or dependency scopes for Starters that aren’t needed in production (e.g., development-support Starters)
  • Lean on the Spring Boot BOM for version management rather than specifying versions individually

Not going “all-in from the start” is the shortest path to reducing trouble.

Common Pitfalls

1. Assuming No Configuration Is Needed Just Because You Added a Starter

A Starter is a mechanism for “gathering the libraries you need” — it doesn’t automatically configure things to match your business requirements. For example, once you add the Security Starter, you still need to explicitly design your authorization rules and which endpoints are public.

What Happens When You Add spring-boot-starter-security

spring-boot-starter-security is a prime example of a Starter whose behavior changes significantly just by adding it, so let’s look at it in a bit more detail.

implementation 'org.springframework.boot:spring-boot-starter-security'

Adding this one line and starting the application triggers the following automatically:

  • All endpoints now require authentication (opening / in a browser redirects to a login form, and API clients receive a 401)
  • You can log in with the username user and a random password printed in the startup logs
  • CSRF protection and security headers (such as X-Content-Type-Options) become enabled

Many people are surprised when a screen that used to work suddenly shows a login page, but this is expected behavior. In a real application, you need to explicitly design “which paths are public and which require authentication” by defining a SecurityFilterChain bean.

For how to write authorization rules in a minimal configuration, and how to fix a username/password in application.properties, see Steps to Implement Basic Authentication with Spring Security.

2. Leaving Dependency Conflicts Unresolved Until the Cause Becomes Invisible

If you keep overriding versions manually, your application can suddenly stop starting one day. When something feels off with your dependencies, visualize them early using mvn dependency:tree or ./gradlew dependencies.

3. Accidentally Adopting Multiple Starters from the Same Family

For instance, mixing spring-boot-starter-web and spring-boot-starter-webflux without a clear intent can make your architectural direction inconsistent. It’s important to decide upfront whether you’re going with synchronous MVC or reactive.

Not Sure What to Add First?

For learning purposes or a small API, the following are sufficient to start:

  • spring-boot-starter-web
  • spring-boot-starter-validation
  • spring-boot-starter-test

Add spring-boot-starter-data-jpa only when you need a database, and add spring-boot-starter-security once authentication becomes necessary — this kind of incremental approach is easier to manage.

The following articles are a good entry point for how to actually use each Starter.

Quick Reference: Commonly Used Starters

Here’s a summary of the Starters that typically come up first for each use case. To make it easy to see “what exactly gets added when you include this,” the table also lists the main libraries each one bundles. In every case the groupId is org.springframework.boot, so the coordinates take the form org.springframework.boot:<artifactId>. Versions are managed by the Spring Boot BOM, so there’s no need to specify them individually.

Use CaseStarter (artifactId)Main Bundled Libraries
Foundation for all Startersspring-boot-starterspring-boot, spring-boot-autoconfigure, spring-boot-starter-logging (Logback), snakeyaml, jakarta.annotation-api
REST APIspring-boot-starter-webspring-boot-starter, spring-web, spring-webmvc, spring-boot-starter-json (Jackson), spring-boot-starter-tomcat
Reactive Webspring-boot-starter-webfluxspring-boot-starter, spring-webflux, spring-boot-starter-reactor-netty, spring-boot-starter-json
Input Validationspring-boot-starter-validationspring-boot-starter, hibernate-validator, tomcat-embed-el
RDB Accessspring-boot-starter-data-jpaspring-boot-starter-jdbc (HikariCP), hibernate-core, spring-data-jpa, spring-boot-starter-aop
Authentication/Authorizationspring-boot-starter-securityspring-boot-starter, spring-security-config, spring-security-web, spring-aop
Monitoring/Health Checksspring-boot-starter-actuatorspring-boot-starter, spring-boot-actuator-autoconfigure, micrometer-observation, micrometer-core
Testingspring-boot-starter-testspring-boot-test, spring-test, JUnit Jupiter, Mockito, AssertJ, Hamcrest, JSONassert, json-path

For example, when you add spring-boot-starter-web, the foundational spring-boot-starter is pulled in along with it automatically. Because of this, you rarely need to explicitly declare the foundational Starter on its own.

Since the exact list of bundled libraries varies depending on the Spring Boot version, when in doubt, refer to the official reference’s list of Starters. Also, for guidance on when reactive web (WebFlux) is a good fit, see Introduction to Spring Boot WebFlux.

What’s the Difference Between a Starter and AutoConfiguration?

One thing beginners often confuse is the relationship between a Starter and AutoConfiguration. Their roles are clearly separated:

  • Starter: “A set of dependencies that bundles the libraries you need.” It contains almost no code itself; its job is to shorten what you write in pom.xml / build.gradle.
  • AutoConfiguration: “A mechanism that looks at the libraries on the classpath and automatically registers beans.” This is handled by spring-boot-autoconfigure, and is activated based on conditions such as @ConditionalOnClass.

When you add spring-boot-starter-web, Tomcat and Spring MVC get placed on the classpath, and AutoConfiguration detects this and automatically configures things like DispatcherServlet and the embedded Tomcat server — it’s a two-step process. For details on this mechanism, see How Spring Boot’s AutoConfiguration Mechanism Works.

What If You Want to Use Jetty or Undertow Instead of Tomcat?

spring-boot-starter-web includes Tomcat as its embedded server. If you want to swap it for a different server, exclude the Tomcat Starter and add the alternative Starter instead.

For Maven:

<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-web</artifactId>
    <exclusions>
        <exclusion>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-tomcat</artifactId>
        </exclusion>
    </exclusions>
</dependency>
<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-jetty</artifactId>
</dependency>

For Gradle:

dependencies {
    implementation('org.springframework.boot:spring-boot-starter-web') {
        exclude group: 'org.springframework.boot', module: 'spring-boot-starter-tomcat'
    }
    implementation 'org.springframework.boot:spring-boot-starter-jetty'
}

Since “a Starter is just a bundle,” you can exclude and replace just a part of it like this.

Why Don’t You Need to Specify a Version?

The reason Starter declarations don’t include a version is that spring-boot-starter-parent (Maven) or Spring Boot’s Gradle plugin manages compatible versions collectively through a BOM (Bill of Materials). By deciding your Spring Boot version in one place, a verified, compatible combination of Spring Framework, Hibernate, Jackson, Tomcat, and so on is automatically selected.

Overriding versions individually tends to break this consistency and often causes startup errors. The basic rule is “let the BOM handle versions.”

Target Version of This Article and Starter Name Changes

When migrating from 2.x to 3.x, there are breaking changes such as the Java 17 requirement and the javax → jakarta package replacement, so see the Spring Boot 2.x to 3.x Migration Guide for that case.

With the module reorganization in Spring Boot 4.x, a new Starter named spring-boot-starter-webmvc was introduced for Web MVC. Here’s how it relates to the spring-boot-starter-web covered in this article:

  • If you’re using the 3.x series, spring-boot-starter-web continues to work exactly as described here.
  • If you’re migrating to the 4.x series, check the release notes for the version you adopt to see whether spring-boot-starter-web is still provided, or whether you need to switch to spring-boot-starter-webmvc.
  • Regardless of which name is used, the underlying role — “a Starter that bundles the dependencies needed for Web MVC” — remains unchanged.

It’s a good idea to first check which major version you’re using, and then choose the corresponding Starter name. The core idea covered in this article — “a Starter is something that bundles dependencies” — stays the same regardless of version.

Practical Commands for Checking Dependencies

To understand “why this library is included,” checking the dependency tree is helpful.

Maven

./mvnw dependency:tree

Gradle

./gradlew dependencies

As dependencies grow, simply trimming unnecessary Starters can sometimes improve startup speed and maintainability.

Summary

As you can see, Spring Boot Starter is a powerful tool for simplifying dependency management and improving development efficiency. Understanding Starters is essential when learning Spring Boot. Try out various Starters for yourself and experience just how convenient they are!

Next Steps

Once you understand how Starters work, the following articles will help you see the “behind the scenes” of Spring Boot.

What Is spring-boot-starter-webmvc?

spring-boot-starter-webmvc is a Starter introduced in Spring Boot 4.x for Web MVC, and its role is essentially the same as spring-boot-starter-web. For those migrating from 3.x, it’s safe to think of it as simply a name change.