Spring Boot 4 is undergoing a significant modularization effort to address the growth of its autoconfigure jar. Initially small, the autoconfigure jar has ballooned to 2 MiB due to the addition of support for numerous technologies. This monolithic approach leads to unnecessary auto-complete suggestions and increased mental load for developers.
Spring Boot 4 will split functionality into smaller, focused modules for better maintainability, clarity, and a leaner runtime footprint. Each supported technology will have its own starter, with some being new in Spring Boot 4. This modularization offers improved maintainability through enforced module boundaries, reduced artifact sizes, and clearer signals for dependency usage.
The modularization also enables new use cases, such as using Micrometer metrics independently of Actuator. Test auto-configuration has also been modularized, with test-specific modules and corresponding test starter POMs for every regular starter. Migrating to Spring Boot 4 involves refining starter dependencies, adopting new test starters, adjusting manual configurations, and reviewing custom starters.
Classic starter POMs are retained to ease the transition, allowing developers to use bundled modules initially. This modular architecture aims for a more maintainable, composable, and lean framework. The benefits of modularity, including clarity and reduced footprint, make the migration a worthwhile investment. Developers are encouraged to use specific modules for lighter applications or leverage classic starters for a phased migration.
spring.io
spring.io
