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>
More Related questions...