# Spring Boot Starters and Dependency Management

> What are Spring Boot starters, and how do they help with dependency management?

Canonical: https://www.internhack.in/learn/interview/spring-boot-interview/spring-boot-starters
Last updated: 2026-11-28

Difficulty: Beginner

## Question

What are Spring Boot starters, and how do they help with dependency management?

## Answer

Anyone who worked with older Spring remembers the pain of building a web project. You needed spring-webmvc, Jackson, a validation API, a logging setup, and Tomcat, and each had to be a compatible version. One wrong version and you would spend an afternoon reading a NoSuchMethodError stack trace. Starters exist to eliminate that whole class of problem.

A starter is a convenience dependency descriptor, essentially a pom with no code of its own that pulls in a curated group of libraries for one purpose. Add spring-boot-starter-web and you get Spring MVC, Jackson for JSON, an embedded Tomcat, and validation-related basics all at once. spring-boot-starter-data-jpa brings Spring Data JPA, Hibernate, and a transaction support. spring-boot-starter-security brings Spring Security, spring-boot-starter-test brings JUnit 5, Mockito, AssertJ, and Spring Test, and spring-boot-starter-actuator brings production endpoints. The naming convention is spring-boot-starter-something for official ones, while third parties use something-spring-boot-starter to avoid confusion.

Version alignment is the second half of the story. Your project inherits from spring-boot-starter-parent, or imports the spring-boot-dependencies BOM, which is a Bill of Materials listing tested versions of hundreds of libraries. That is why you write the dependency without a version number and Maven or Gradle picks the one Boot has verified. When you upgrade Boot from 3.2 to 3.3 the whole set of transitive versions moves together consistently. If you must override a version, say for a security fix, you set a property such as jackson-bom.version or specify the version explicitly, understanding that you leave the tested path.

Starters also work together with auto-configuration. The starter puts libraries on the classpath, and auto-configuration notices them and configures beans. That combination is the reason a project goes from empty to a running REST service in a few minutes. Remove the starter and the associated auto-configuration disappears because its class conditions no longer hold.

Practical hygiene worth mentioning: swap the default server by excluding spring-boot-starter-tomcat and adding spring-boot-starter-jetty. Use mvn dependency:tree to see what a starter pulled in when you are chasing a conflict. Avoid adding starters you do not use, since each one increases the startup time, the JAR size, and the attack surface. And do not mix a starter with manually chosen conflicting versions of the same library.

In an interview, tie it together in a sentence: starters give you the right dependencies, the BOM gives you the right versions, and auto-configuration gives you the right beans.

## Code examples

### Typical pom.xml dependencies

```
<parent>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-parent</artifactId>
    <version>3.3.4</version>
</parent>

<dependencies>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-web</artifactId>   <!-- no version needed -->
    </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>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-test</artifactId>
        <scope>test</scope>
    </dependency>
</dependencies>
```

Versions come from the parent BOM, so all Spring, Hibernate, Jackson and Tomcat versions stay compatible.

## Key points

- A starter contains no code, just dependencies.
- spring-boot-starter-parent or the dependencies BOM controls versions.
- Third-party starters are named library-spring-boot-starter.
- Use mvn dependency:tree to inspect transitive dependencies.

## Common follow-up questions

- How do you replace Tomcat with Jetty?
- What is a BOM?
- How would you override a managed dependency version?

## Interview tips

- Explain both halves: the dependency bundle and the version management.
- Link starters to auto-configuration to show you see the whole system.

## Concepts covered

Starters, BOM, Maven, Dependency Management

Previous: [How @SpringBootApplication and Auto-Configuration Work](https://www.internhack.in/learn/interview/spring-boot-interview/spring-boot-autoconfiguration-springbootapplication) · Next: [application.properties, YAML and Profiles](https://www.internhack.in/learn/interview/spring-boot-interview/spring-properties-yaml-profiles) · [All of Spring Boot](https://www.internhack.in/learn/interview/spring-boot-interview)

## More Spring Boot questions

- [@RestController vs @Controller](https://www.internhack.in/learn/interview/spring-boot-interview/spring-restcontroller-vs-controller)
- [@PathVariable vs @RequestParam vs @RequestBody](https://www.internhack.in/learn/interview/spring-boot-interview/spring-request-mapping-pathvariable-requestparam-requestbody)
- [Bean Validation with @Valid and @Validated](https://www.internhack.in/learn/interview/spring-boot-interview/spring-validation-valid)
- [Global Exception Handling with @ControllerAdvice](https://www.internhack.in/learn/interview/spring-boot-interview/spring-controlleradvice-global-exception-handling)
- [ResponseEntity and Correct HTTP Status Codes](https://www.internhack.in/learn/interview/spring-boot-interview/spring-responseentity)
- [Spring Data JPA: Repositories, Derived Queries and @Query](https://www.internhack.in/learn/interview/spring-boot-interview/spring-data-jpa-repositories-queries)

## Related

- [Learn](https://www.internhack.in/learn)
- [Interview Prep](https://www.internhack.in/learn/interview)
- [Spring Boot](https://www.internhack.in/learn/interview/spring-boot-interview)
