Interview kitsBlog

Your dream job? Lets Git IT.
Interactive technical interview preparation platform designed for modern developers.

XGitHub

Platform

  • Categories

Resources

  • Blog
  • About the app
  • FAQ
  • Feedback

Legal

  • Privacy Policy
  • Terms of Service

© 2026 LetsGit.IT. All rights reserved.

LetsGit.IT/Categories/Spring
Springmedium

What is Spring Boot auto-configuration (and what are starters)?

Tags
#spring-boot#auto-configuration#starter
Back to categoryPractice quiz

Answer

Boot auto-configures beans based on what’s on the classpath and your properties (so you get sensible defaults). Starters are dependency bundles (e.g., `spring-boot-starter-web`) that pull common libraries and enable related auto-config.

Advanced answer

Deep dive

Spring Boot auto-configuration is a set of `@Configuration` classes enabled by `@SpringBootApplication` (via `@EnableAutoConfiguration`). Boot decides what to configure based on:

  • what’s on the **classpath**,
  • your **application properties**,
  • and `@Conditional...` rules (e.g., `@ConditionalOnClass`, `@ConditionalOnMissingBean`).

Starters (like `spring-boot-starter-web`, `spring-boot-starter-security`, `spring-boot-starter-data-jpa`) are curated dependency sets that:

  • pull in common libraries for a feature,
  • keep versions aligned through Boot’s dependency management.

How to customize

  • Prefer properties first (stable and easy).
  • Define your own beans to override defaults (many auto-configs back off if a user bean exists).
  • Exclude an auto-config when you don’t want it:
@SpringBootApplication(exclude = DataSourceAutoConfiguration.class)

Common pitfalls

  • Adding a starter and being surprised by default behavior (security is a classic).
  • Overriding beans accidentally and breaking auto-configured wiring.
  • Different classpaths between environments causing different auto-config behavior.

Related questions

Spring
`@ConfigurationProperties` vs `@Value`: when should you prefer `@ConfigurationProperties`?
#spring-boot#configuration#properties
Spring
Spring Boot auto‑configuration: how does it work at a high level?
#spring-boot#auto-configuration#starters
Spring
Spring Boot config precedence: which sources typically override which?
#spring-boot#configuration#profiles
Spring
Spring Boot Actuator: what is it and why should you secure it?
#spring-boot#actuator#observability
Spring
Why use `@ConfigurationProperties` instead of many `@Value` annotations?
#spring-boot#configuration#properties
Spring
What are Spring Boot Starters?
#spring-boot#dependency#configuration