Spring / Spring Boot 4 Basics Interview Questions
What is the complete modularisation of Spring Boot 4 and why does it matter?
One of the most architecturally significant changes in Spring Boot 4 is the complete modularisation of the codebase into 70+ focused JAR modules. Previously, the two monolithic JARs -- spring-boot-autoconfigure and spring-boot-test-autoconfigure -- contained auto-configuration for every supported technology regardless of what your project actually used.
Why it matters:
- Smaller application footprint -- you only include modules for technologies you actually use
- Faster builds and startup times -- less classpath scanning and fewer classes to load
- Better GraalVM native images -- smaller reachability surface means smaller native binaries
- Cleaner IDE auto-complete -- no longer suggests classes from libraries you haven't included
- Clearer dependency management -- easier to reason about what is on the classpath and why
| Spring Boot 3 | Spring Boot 4 | What it contains |
|---|---|---|
| spring-boot-starter-web | spring-boot-starter-webmvc | Spring MVC + Tomcat |
| spring-boot-starter-web | spring-boot-starter-webflux | WebFlux (if reactive) |
| spring-boot-autoconfigure (monolith) | 70+ focused modules | One module per technology |
| spring-boot-test-autoconfigure (monolith) | spring-boot-starter-webmvc-test etc. | Test slices per technology |
<!-- Spring Boot 3 (monolithic starter) --> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> </dependency> <!-- Spring Boot 4 (modular starters) --> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-webmvc</artifactId> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-jackson</artifactId> </dependency> <!-- For gradual migration: classic starters bridge the gap --> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-classic</artifactId> <!-- bundles old behaviour --> </dependency>
Invest now in Acorns!!! 🚀
Join Acorns and get your $5 bonus!
Acorns is a micro-investing app that automatically invests your "spare change" from daily purchases into diversified, expert-built portfolios of ETFs. It is designed for beginners, allowing you to start investing with as little as $5. The service automates saving and investing. Disclosure: I may receive a referral bonus.
Invest now!!! Get Free equity stock (US, UK only)!
Use Robinhood app to invest in stocks. It is safe and secure. Use the Referral link to claim your free stock when you sign up!.
The Robinhood app makes it easy to trade stocks, crypto and more.
Webull! Receive free stock by signing up using the link: Webull signup.
More Related questions...
