Starter Dependencies

Master Spring Boot Starters — the curated dependency bundles that eliminate version conflicts and bring everything you need for a feature with a single dependency.

Last reviewed: January 2025

·Spring Boot 2.7Spring Boot 3.x
✅
Quick Understanding: A Spring Boot Starter is a single Maven/Gradle dependency that pulls in everything you need for a specific feature. Add spring-boot-starter-web and you get Spring MVC, Jackson, Tomcat, and validation — all at compatible versions. No more hunting for which version of Jackson works with which version of Spring.

🔍 What Is It?

Spring Boot Starters are curated dependency descriptors — POMs that declare a set of related dependencies that work well together.

Most important starters:

  • →spring-boot-starter — core: logging, auto-config, Spring core
  • →spring-boot-starter-web — Spring MVC, Tomcat, Jackson, validation
  • →spring-boot-starter-data-jpa — Hibernate, Spring Data JPA, JDBC
  • →spring-boot-starter-security — Spring Security
  • →spring-boot-starter-test — JUnit 5, Mockito, AssertJ, MockMvc
  • →spring-boot-starter-actuator — health, metrics, management endpoints
  • →spring-boot-starter-validation — Hibernate Validator, Jakarta Validation
  • →spring-boot-starter-cache — Spring Cache abstraction
  • →spring-boot-starter-data-redis — Lettuce Redis client, Spring Data Redis
  • →spring-boot-starter-amqp — RabbitMQ, Spring AMQP
  • →spring-boot-starter-kafka — Apache Kafka, Spring Kafka
  • →spring-boot-starter-mail — JavaMail, Spring Mail
  • →spring-boot-starter-webflux — Spring WebFlux, Reactor (reactive)

Parent POM:

spring-boot-starter-parent manages all dependency versions — you never specify versions for Spring Boot managed dependencies.

🎯 Why Do We Need It?

Before starters, adding JPA to a Spring project meant:

  1. Find the right Hibernate version
  2. Find the Spring ORM version compatible with it
  3. Find the Spring Data JPA version compatible with Spring ORM
  4. Find the connection pool version that works
  5. Resolve the 15 transitive dependency conflicts
  6. Discover at runtime that two versions are incompatible

Starters eliminate all of this. The Spring Boot team tests all combinations and releases them as a BOM (Bill of Materials). You get one version number (the Boot version) and everything works together.

🏗️ What Happens in Real Projects?

In a typical enterprise microservice, you'll use 6-10 starters:

<!-- The essentials for a REST API with database -->
spring-boot-starter-web          → REST endpoints
spring-boot-starter-data-jpa     → database access
spring-boot-starter-security     → authentication
spring-boot-starter-validation   → request validation
spring-boot-starter-actuator     → health checks for Kubernetes
spring-boot-starter-test         → all testing dependencies

For event-driven microservices, add:

spring-boot-starter-kafka        → Kafka consumer/producer
spring-boot-starter-data-redis   → Redis for caching/session

⚙️ How It Works

Dependency resolution:

  1. You add spring-boot-starter-web to your POM
  2. Maven/Gradle resolves its dependencies: spring-webmvc, spring-web, tomcat-embed-core, jackson-databind, etc.
  3. Versions come from spring-boot-dependencies BOM (imported by starter-parent)
  4. No version conflicts because all versions are pre-tested together

spring-boot-starter-parent:

  • →Inherits from spring-boot-dependencies BOM
  • →Manages 300+ dependency versions
  • →Configures Maven plugins (compiler, surefire, failsafe)
  • →Sets Java source encoding to UTF-8
  • →Enables resource filtering for application.properties

💻 Example

Starter Dependencies in Practice — How to use starters and customize their transitive dependencies.

xml
<parent>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-parent</artifactId>
    <version>3.2.1</version>
</parent>

<dependencies>
    <!-- Web: Spring MVC + Tomcat + Jackson -->
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-web</artifactId>
    </dependency>

    <!-- JPA: Hibernate + Spring Data + JDBC -->
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-data-jpa</artifactId>
    </dependency>

    <!-- Security -->
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-security</artifactId>
    </dependency>

    <!-- Validation: @Valid, @NotNull, etc. -->
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-validation</artifactId>
    </dependency>

    <!-- Actuator: /health, /metrics, /info -->
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-actuator</artifactId>
    </dependency>

    <!-- Database driver (version managed by Boot) -->
    <dependency>
        <groupId>org.postgresql</groupId>
        <artifactId>postgresql</artifactId>
        <scope>runtime</scope>
    </dependency>

    <!-- Testing -->
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-test</artifactId>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>org.springframework.security</groupId>
        <artifactId>spring-security-test</artifactId>
        <scope>test</scope>
    </dependency>
</dependencies>

🤔 Common Confusions

❓ Do I need to specify versions for starter dependencies?

No — if you use spring-boot-starter-parent as your parent POM, all Spring Boot managed dependencies have their versions controlled by the BOM. Only specify versions for dependencies NOT managed by Spring Boot (e.g., your company's internal libraries).

❓ What is the difference between spring-boot-starter and spring-boot-starter-web?

spring-boot-starter is the base starter (logging, auto-config, Spring core). spring-boot-starter-web extends it with Spring MVC, Tomcat, and Jackson. Most web apps use spring-boot-starter-web which transitively includes the base starter.

❓ Should I use spring-boot-starter-web or spring-boot-starter-webflux?

Use spring-boot-starter-web (servlet-based) for standard REST APIs — it's simpler, well-understood, and works with all JPA/JDBC libraries. Use spring-boot-starter-webflux (reactive) only if you need non-blocking I/O for very high concurrency or are building reactive pipelines. Don't mix them in the same app.

🚨 Common Production Issues

Dependency version override conflicts — if you override a managed version, ensure it's compatible with all other managed deps

spring-boot-starter-test pulling in outdated JUnit 4 — it includes JUnit 5 by default; JUnit 4 is vintage and optional

Classpath scanning slowed by too many jars — use spring-context-indexer to pre-compute component index

Fat JAR size bloat — audit with mvn dependency:tree and exclude unused transitive dependencies

✅ Best Practices

Always use spring-boot-starter-parent to get managed dependency versions

Never manually specify versions for Spring-managed dependencies

Use mvn dependency:tree to understand what a starter brings in

Exclude embedded Tomcat if deploying to an external container

Add spring-boot-starter-actuator to every production service for health checks

Use spring-boot-starter-test in test scope — it includes JUnit 5, Mockito, AssertJ

🏛️ Architect's Note

Senior Architect's Perspective

When building internal platform libraries for your organization, package them as custom Spring Boot starters. Name them {company}-{feature}-spring-boot-starter. This pattern means application teams add one dependency and get a fully configured, production-ready feature. This is how companies build internal SDKs for observability, security, audit logging, and feature flags — all as Spring Boot starters.

💬 Frequently Asked Questions

How do I see what a starter actually pulls in?

Run mvn dependency:tree -Dincludes=org.springframework.boot to see all Spring Boot dependencies. In IntelliJ, open the Maven panel → Dependencies to see the full tree. The spring-boot-starter-web pulls in ~15 direct dependencies.

Can I use Spring Boot without the starter-parent POM?

Yes — import spring-boot-dependencies as a BOM in your dependencyManagement section. This is useful when your project already has a corporate parent POM. Add: <type>pom</type><scope>import</scope> in dependencyManagement.

🎯 Key Takeaways

1Starters are curated dependency bundles — one dependency brings everything needed for a feature
2spring-boot-starter-parent manages all dependency versions via a BOM
3Never specify versions for Spring Boot managed dependencies
4spring-boot-starter-test includes JUnit 5, Mockito, AssertJ, and MockMvc
5You can exclude and swap transitive dependencies (e.g., Tomcat → Undertow)
6Build internal platform features as custom Spring Boot starters

🎯 Practice this topic in interviews

↗ Where this topic fits

Sources

Sources / References

Use these Spring Boot references to verify the concept in official docs and continue into the most relevant SplashRide pages.

Related SplashRide pages

SplashRide Spring Boot learning path

Browse the full Spring Boot topic collection and learning order on SplashRide.

Spring Boot Interview Prep

Practice Spring Boot interview questions and scenario-based answers.

Backend Engineer Career Path

A structured journey through Core Java, Spring Boot, production backend engineering, and interview preparation.

Full Stack Java Developer Career Path

A guided route through frontend foundations, Java backend engineering, delivery workflows, and interview readiness.

Spring Boot Introduction

Understand what Spring Boot is, why it exists, and how it transforms enterprise Java development by eliminating boilerplate configuration.

Auto Configuration

Understand how Spring Boot's auto-configuration works under the hood — how it detects your classpath, applies conditional configuration, and how to customize or disable it.