ArchitectMind
  1. Home
  2. Java Ecosystem
  3. Book 4 · Spring & Spring Boot
  4. Volume III
  5. Starter Concept
Book 4 · Volume III — Spring Boot, Configuration & Application Lifecycle · Topic 2.1

Starter Concept

Dependency aggregation and consistent dependency versions

10 min readStage 2 · Frameworks & design8 interview questions
Chapter
Chapter 2 — Spring Boot Starters
Prerequisites
Chapter 1
You will be able to
Explain what a starter is, inspect what it brings, relate starters to the BOM, and design starters for your own organisation
Covers
Dependency Aggregation · Consistent Dependency Versions
On this page
  1. 1. Concept / Definition
  2. 2. Why It Exists
  3. 3. Core Concepts
  4. 4. How It Works Internally
  5. 4A. Deep Dive — Designing Internal Starters
  6. 5. APIs / Features / Syntax
  7. 6. Practical Examples
  8. 7. Common Problems & Mistakes
  9. 8. Performance & Production Considerations
  10. 9. Architecture & Design Considerations
  11. 10. Interview Questions & Answers

1Concept / Definition

A starter is a dependency descriptor — a POM with no code — that aggregates the libraries needed for one capability. Declaring a single starter brings a tested set of transitive dependencies, including the Boot module that auto-configures them. Versions are not specified in the starter declaration; they come from Boot's bill of materials (BOM), which guarantees a consistent combination.

One starter pulls a curated set of libraries
Figure 1 — One starter pulls a curated set of libraries
XML
<!-- Without a version: managed by the Spring Boot BOM -->
<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-webmvc</artifactId>
</dependency>
Property of a starterMeaning
No Java codeOnly a list of dependencies (and sometimes exclusions)
Capability-orientedOne starter per technology or feature (web MVC, JPA, Kafka…)
TransitiveBrings libraries, the Boot core starter and the technology's auto-configuration module
Versionless in your buildVersions inherited from the Boot BOM
Paired with a test starter (Boot 4)spring-boot-starter-<tech>-test provides the testing support
Table 1 — Characteristics of a starter

2Why It Exists

Before starters, adopting a capability such as JPA meant finding the right artefacts (Hibernate core, the JPA API, a connection pool, Spring ORM, Spring Data), choosing versions that worked together and repeating the exercise in every project. Starters encode that knowledge once. They also act as the switch for Boot's auto-configuration: because each auto-configuration is guarded by classpath conditions, putting the starter's libraries on the classpath is what enables the corresponding beans.

Hand-picked dependencies versus starters
Figure 2 — Hand-picked dependencies versus starters

3Core Concepts

3.1 Dependency aggregation

TEXT
$ mvn dependency:tree -Dincludes=org.springframework*,org.hibernate*,com.zaxxer
[INFO] com.acme:orders:jar:1.0
[INFO] \- org.springframework.boot:spring-boot-starter-data-jpa:jar:4.0.0
[INFO]    +- org.springframework.boot:spring-boot-starter-jdbc:jar:4.0.0
[INFO]    |  +- org.springframework.boot:spring-boot-jdbc:jar:4.0.0
[INFO]    |  \- com.zaxxer:HikariCP:jar:…
[INFO]    +- org.springframework.boot:spring-boot-data-jpa:jar:4.0.0
[INFO]    +- org.hibernate.orm:hibernate-core:jar:7.x
[INFO]    \- org.springframework.data:spring-data-jpa:jar:4.x
Anatomy of a Boot 4 starter
Figure 3 — Anatomy of a Boot 4 starter
Layer inside the treeExample for Data JPA
Core starterspring-boot-starter (Boot core, logging, YAML support)
Other starters reusedspring-boot-starter-jdbc (DataSource, HikariCP)
Boot technology modulespring-boot-data-jpa — auto-configuration and support classes
LibrariesHibernate ORM 7, Spring Data JPA, Jakarta Persistence API
Table 2 — Layers aggregated by a starter

Starters compose: higher-level starters depend on lower-level ones rather than repeating their contents. This keeps each technology's dependency list in one place.

3.2 Consistent dependency versions

How versions stay consistent
Figure 4 — How versions stay consistent

The versions of everything a starter brings — Spring projects and third-party libraries — are defined in spring-boot-dependencies. Your build imports that BOM (via spring-boot-starter-parent, dependencyManagement import, or the Gradle plugin/platform), and declares starters without versions. The effect:

Without BOM alignmentWith BOM alignment
Each project chooses versions independentlyAll projects on Boot 4.0.x use the same versions
Transitive dependencies may disagreeManaged versions override transitive ones
Upgrades require per-library researchUpgrading Boot upgrades a tested combination
Runtime errors like NoSuchMethodErrorCombinations integration-tested by the Boot team
Table 3 — Why aligned versions matter

4How It Works Internally

1. A starter POM declares its dependencies with versions inherited from spring-boot-dependencies (the starter itself is part of the Boot release).

2. Your build resolves the starter; its transitive dependencies are added to the classpath.

3. Where your build imports the Boot BOM, managed versions override the versions requested by transitive dependencies (Maven dependencyManagement semantics; Gradle platform constraints).

4. At runtime, auto-configuration classes in the technology module check for classes (@ConditionalOnClass) that the starter made available and create beans accordingly.

Boot 4 naming conventionPatternExample
Technology modulespring-boot-<technology>spring-boot-kafka
Root packageorg.springframework.boot.<technology>org.springframework.boot.kafka
Starterspring-boot-starter-<technology>spring-boot-starter-kafka
Test starterspring-boot-starter-<technology>-testspring-boot-starter-kafka-test
Table 4 — Boot 4 naming conventions

4ADeep Dive — Designing Internal Starters

Organisations use the same mechanism to encode company standards: an internal starter can bundle approved libraries, a company auto-configuration (logging format, security defaults, tracing headers, error format) and configuration metadata.

Design ruleReason
Name it acme-<feature>-spring-boot-starterThe spring-boot-starter-* prefix is reserved for Spring Boot
Keep code in a separate -autoconfigure moduleStarter stays a pure dependency list; auto-config can be used alone
Do not pin versions managed by the Boot BOMLet the application's Boot version decide; avoid conflicts
Depend on the minimum set of librariesEvery dependency activates auto-configuration somewhere
Mark optional integrations optionalConsumers opt in by adding the library themselves
Version it with a compatibility matrix"acme-platform 5.x supports Boot 4.0.x"
Table 5 — Rules for internal starters
XML
<!-- acme-observability-spring-boot-starter/pom.xml -->
<dependencies>
  <dependency>
    <groupId>com.acme.platform</groupId>
    <artifactId>acme-observability-spring-boot-autoconfigure</artifactId>
  </dependency>
  <dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-actuator</artifactId>   <!-- no version: BOM -->
  </dependency>
  <dependency>
    <groupId>io.micrometer</groupId>
    <artifactId>micrometer-tracing-bridge-otel</artifactId>
  </dependency>
</dependencies>

5APIs / Features / Syntax

Artefact / toolPurpose
spring-boot-starterCore starter: Boot, auto-configuration support, logging, YAML
spring-boot-starter-<technology>Capability starters
spring-boot-starter-<technology>-testTest companions (bring spring-boot-starter-test)
spring-boot-starter-classic / -test-classicBoot 4 migration aid: all modules, like Boot 3
spring-boot-dependenciesThe BOM
mvn dependency:tree, gradle dependenciesInspect what a starter brings
start.spring.ioGenerate projects with chosen starters
Table 6 — Starter-related artefacts and tools

6Practical Examples

6.1 Gradle with the Boot plugin

KOTLIN
plugins {
    java
    id("org.springframework.boot") version "4.0.0"
    id("io.spring.dependency-management") version "1.1.7"
}
dependencies {
    implementation("org.springframework.boot:spring-boot-starter-webmvc")
    implementation("org.springframework.boot:spring-boot-starter-data-jpa")
    runtimeOnly("org.postgresql:postgresql")
    testImplementation("org.springframework.boot:spring-boot-starter-webmvc-test")
    testImplementation("org.springframework.boot:spring-boot-starter-data-jpa-test")
}

6.2 Swapping a transitive choice: Jetty instead of Tomcat

XML
<dependency>
  <groupId>org.springframework.boot</groupId>
  <artifactId>spring-boot-starter-webmvc</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>

6.3 Finding which starter brought a library

TEXT
$ ./gradlew dependencyInsight --dependency HikariCP --configuration runtimeClasspath
com.zaxxer:HikariCP:… (selected by rule)
\--- org.springframework.boot:spring-boot-starter-jdbc:4.0.0
     \--- org.springframework.boot:spring-boot-starter-data-jpa:4.0.0

6.4 Starter checklist for a new service

QuestionTypical answer
HTTP API?-webmvc (blocking) or -webflux (reactive)
Relational data?-data-jpa or -data-jdbc / -jdbc, plus -flyway or -liquibase
Security?-security, -security-oauth2-resource-server for JWT APIs
Input validation?-validation
Operations?-actuator (+ -opentelemetry / -micrometer-metrics as needed)
Messaging?-kafka, -amqp or -jms
Tests?The -test companion of each starter used
Table 7 — Selecting starters

6.5 Boot 4 classic starters as a migration bridge

XML
<!-- Temporary: restores a Boot 3-like classpath with all auto-configuration modules -->
<dependency>
  <groupId>org.springframework.boot</groupId>
  <artifactId>spring-boot-starter-classic</artifactId>
</dependency>
<dependency>
  <groupId>org.springframework.boot</groupId>
  <artifactId>spring-boot-starter-test-classic</artifactId>
  <scope>test</scope>
</dependency>
PhaseBuild contentsGoal
1 — BridgeClassic starters + existing third-party dependenciesCompile and run on Boot 4; fix imports and API changes
2 — IdentifyRemove classic starters; follow compilation and start-up failuresDiscover which technology starters are really needed
3 — ModularExplicit technology starters and test companionsMinimal, visible, supportable classpath
Table 8 — Migrating to modular starters in three phases

The classic starters provide all modules but not their third-party libraries, so the application still needs its existing library dependencies. They are a stepping stone, not a destination.

6.6 Starters versus direct module dependencies

Declare…You getUse when
spring-boot-starter-data-jpaBoot module + Hibernate + Spring Data + HikariCP + core starterNormal applications
spring-boot-data-jpa (module only)Auto-configuration only; you choose librariesUnusual stacks (different pool or provider versions)
Raw libraries onlyNo auto-configuration modulePlain Framework usage or libraries
Table 9 — Levels of dependency declaration

7Common Problems & Mistakes

  • Adding versions to starters. Overrides the BOM for that artefact only, creating mismatches.
  • Adding raw libraries instead of starters (e.g. hibernate-core) and wondering why auto-configuration or managed versions are missing.
  • Unused starters activating unwanted auto-configuration (e.g. a DataSource required at start-up).
  • Forgetting test starters in Boot 4 — test slices or security test support not working.
  • Using spring-boot-starter-* names for internal starters: that prefix is reserved for official Spring Boot starters, so name yours acme-spring-boot-starter.
  • Leaving the classic starter in place after a Boot 4 migration, hiding real dependencies.

Most of these mistakes come from treating the build file as a shopping list rather than as configuration. Every starter on the classpath can switch on auto-configuration, so a forgotten spring-boot-starter-data-jpa makes an otherwise stateless service fail at start-up because no DataSource URL is set, while a raw hibernate-core dependency gives you the library without the Boot module that configures it. Pinning a version on one artefact breaks the BOM's guarantee for that family only, which is why the result is a NoSuchMethodError in a rarely used path rather than a build failure. Internal starters must use a company prefix, such as acme-observability-spring-boot-starter, because the spring-boot-starter- prefix belongs to the Boot project. A quick review of mvn dependency:tree and the conditions report after every dependency change catches most of these problems before they reach production.

8Performance & Production Considerations

ConcernGuidance
Image sizeEvery starter adds jars; remove unused ones to shrink images and CVE surface
Start-up timeFewer auto-configurations to evaluate and fewer beans to create
Security scanningStarters make transitive dependencies explicit in SBOMs; review them
Upgrade effortStarter-based builds upgrade cleanly with the Boot version
Table 10 — Production guidance

9Architecture & Design Considerations

  • Starters are the unit of technology adoption. Governance ("approved technologies") maps naturally to approved starters.
  • Internal starters encode platform standards and distribute them through dependency upgrades instead of documentation.
  • Keep services' starter sets minimal and intentional; review them like architecture decisions.
  • Boot 4's per-technology modules make dependencies visible — use that visibility in reviews and SBOMs.

10Interview Questions & Answers

Q1L1 · BasicConcept

What is a Spring Boot starter?

A starter is a dependency descriptor, essentially a POM with no Java code, that aggregates everything needed for one capability. Declaring spring-boot-starter-data-jpa, for example, brings the core starter with logging and YAML support, the JDBC starter with HikariCP, Hibernate ORM, Spring Data JPA, the Jakarta Persistence API and, in Boot 4, the spring-boot-data-jpa module that holds the auto-configuration. You declare it without a version, because versions come from the Boot BOM. Starters compose, so higher-level starters reuse lower-level ones rather than repeating their contents. The practical meaning is a compatibility promise: these libraries, at these versions, are tested together and configured by Boot when they appear on the classpath.

Q2L1 · BasicConcept

Why don't you specify versions for starters?

Because the version is already decided by the Spring Boot BOM, spring-boot-dependencies, which your build imports through spring-boot-starter-parent, a dependencyManagement import or the Gradle plugin. The BOM defines the version of every starter and of the libraries they bring, Spring projects and third-party ones such as Jackson, Hibernate and Tomcat, and the Boot team tests that combination together. Leaving versions out means upgrading Boot upgrades the whole set in one step, and Maven's dependencyManagement or Gradle's platform constraints also override conflicting transitive versions. Adding a version to one starter or library breaks that guarantee for that artefact only, which is how NoSuchMethodError and ClassNotFoundException appear at runtime in builds that compile cleanly.

Q3L2 · IntermediateInternals

How do starters relate to auto-configuration?

Starters decide what is on the classpath, and auto-configuration decides what to do about it. A starter adds the libraries plus, in Boot 4, the technology module such as spring-boot-kafka that contains the auto-configuration classes. At start-up Boot loads the auto-configuration candidates listed in each module's AutoConfiguration.imports file and evaluates their conditions: @ConditionalOnClass checks that the library is present, @ConditionalOnProperty checks settings, and @ConditionalOnMissingBean backs off if you defined your own bean. When the conditions match, the beans are created, such as a KafkaTemplate. So adding a starter effectively switches a capability on, and removing it switches the capability off, which is why starters should be chosen deliberately.

Q4L2 · IntermediateConcept

What changed about starters in Spring Boot 4?

Boot 4 modularised the code base. Instead of one large spring-boot-autoconfigure JAR, each technology has its own module, such as spring-boot-kafka with the root package org.springframework.boot.kafka, its own starter and a matching test starter, such as spring-boot-starter-kafka-test, that provides test slices and support. Several starters were renamed to match, most visibly spring-boot-starter-web becoming spring-boot-starter-webmvc. The effect is that the classpath now shows exactly which technologies a service uses, and unused auto-configuration is never loaded. For migration, spring-boot-starter-classic and spring-boot-starter-test-classic restore a Boot 3-like set of all modules, but they are a temporary bridge, not something to keep.

Q5L3 · Senior EngineerCode

How do you replace Tomcat with Jetty in a Boot web application?

Exclude spring-boot-starter-tomcat from the web starter and add spring-boot-starter-jetty, as in the example in section 6.2. The web starter depends on the Tomcat starter by default, so the exclusion removes embedded Tomcat from the classpath, and the Jetty starter adds Jetty's server and servlet modules. At start-up the servlet web server auto-configuration evaluates its conditions, finds the Jetty classes rather than Tomcat's, and creates a JettyServletWebServerFactory, so nothing changes in application code. Properties under server.* keep working, and server.jetty.* exposes Jetty-specific tuning. Check with mvn dependency:tree that no other dependency brings Tomcat back transitively, and remember that Boot 4 no longer supports Undertow, so Tomcat and Jetty are the servlet choices.

Q6L3 · Senior EngineerTricky

What happens if you add an explicit version to a managed dependency?

Your version wins for that artefact only, while its siblings stay on the BOM's version. Many libraries are released as families that must match, such as Jackson modules, Hibernate artefacts or Netty components, so overriding hibernate-core but not the related Hibernate modules, or one Jackson module but not jackson-databind, gives a mixed set. The build compiles because each JAR resolves, but at runtime you get NoSuchMethodError, ClassNotFoundException or subtle behaviour changes, often only on rarely used paths. The safe way to override is the BOM's version property, for example a hibernate.version property in Maven or the equivalent extra property in Gradle, which moves the whole family together, and to document why the override exists.

Q7L4 · Technical ArchitectDesign

How would you design an internal starter for company observability standards?

I would follow Boot's own structure. An acme-observability-spring-boot-autoconfigure module holds the @AutoConfiguration classes, listed in META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports, plus @ConfigurationProperties under an acme.observability prefix, with every bean guarded by @ConditionalOnClass, @ConditionalOnProperty and @ConditionalOnMissingBean so services can override it. It configures the company log format, trace propagation, common metric tags and error format. A separate acme-observability-spring-boot-starter is a pure dependency list: the autoconfigure module, the actuator starter and the OpenTelemetry bridge, with no versions for Boot-managed libraries. I would generate configuration metadata for IDE support, test with ApplicationContextRunner, and publish a compatibility matrix, such as platform 5.x for Boot 4.0.x.

Q8L5 · Solution ArchitectDesign

How can starters support technology governance across many teams?

By making starters the unit of technology adoption. The architecture board publishes an approved list expressed as starters: standard Boot starters that are allowed, ones that need review, and internal starters that wrap capabilities with company defaults, such as security, observability or messaging conventions. Teams adopt a capability by adding a starter, not by assembling libraries, and a platform BOM fixes the Boot version and internal starter versions. CI can then enforce policy, for example by rejecting unapproved starters. Because standards live in code, a security fix or new logging format reaches hundreds of services through a version bump, and architecture reviews can read a service's capabilities from its starter list.

Test your knowledge on this topic →Flashcards from this topic's 8 questions, filtered by level and type.

Free question pack

Get 100 free Core Java interview questions

Subscribe for the Book 1 question pack (PDF, every answer explained) and new tutorials once a week. No spam, unsubscribe anytime. What is in the pack?

Almost done! Check your inbox and click the confirmation link. Your download link arrives as soon as you confirm.