Return to site

🧩🚀 SPRING BOOT 4 MODULARIZATION EXPLAINED (WITHOUT CONFUSING JPMS)

· springboot,spring,java,programmmer

🔸 TL;DR

▪️ Spring Boot 4 splits the big spring-boot-autoconfigure jar into smaller, focused modules for each technology.

▪️ You still use starters as usual, but now they pull in more precise modules (and have matching *-test starters).

▪️ Advanced users can go full “épicerie fine” and depend only on the exact modules they need. 🧂

▪️ This has nothing to do with JPMS (module-info.java) — it’s about Maven/module structure, not JVM module boundaries.

Section image

🔸 WHAT CHANGES WITH SPRING BOOT 4?

▪️ Autoconfiguration is no longer one big jar, but many smaller modules (web, security, Flyway, metrics, etc.).

▪️ Starters are refined: e.g. spring-boot-starter-web → spring-boot-starter-webmvc.

▪️ For each starter, there is now a matching test starter: *-test for focused test support. ✅

▪️ There are “classic starters” that bundle all modules to help you migrate gradually.

🔸 “ÉPICERIE FINE” FOR YOUR DEPENDENCIES 🧺

▪️ Before: you took a big starter and got a lot of things by default.

▪️ Now: you can still do that, but you can also select only sub-parts of what used to be in those starters.

▪️ Example: use WebClient without a web server, or Micrometer metrics without full Actuator.

▪️ Most teams will stay at the starter level; power users can tune their classpath like a fine grocery selection.

🔸 THIS IS NOT JAVA PLATFORM MODULE SYSTEM (JPMS)

▪️ Spring Boot 4 modularization = how the project slices its Maven artifacts/jars.

▪️ JPMS (module-info.java) = JVM-level modules (exports, requires, strong encapsulation).

▪️ You can use Spring Boot 4 with or without JPMS — they are independent concerns.

▪️ Same word “module”, but different layers:

▪️ Spring Boot: dependencies & auto-config grouping

▪️ JPMS: runtime module boundaries in the JVM

🔸 TAKEAWAYS FOR DEV TEAMS 💡

▪️ Expect cleaner IDE completion, fewer “ghost” properties and auto-configs you don’t use.

▪️ Migration = mostly updating starters + adding the correct *-test starters + fixing a few imports.

▪️ Use classic starters if you want a smooth upgrade, then refine modules later.

▪️ Think of it as an opportunity to trim your classpath and better understand what your app really needs.

#SpringBoot4 #SpringBoot #Java #JavaDeveloper #Microservices #CleanArchitecture #DeveloperExperience #Modularization

Go further with Java certification:

Java👇

Spring👇

SpringBook👇