Spring Boot 4's Autoconfig Split Silently Breaks Flyway: A Field Guide to Surviving the Dependency Tree Overhaul
Auto-configuration now fails silently after upgrading to Boot 4, so teams can ship with missing beans and broken database migrations without any error or log. The modularization turns the dependency tree into a contract that must be diffed, gated, and tested before deployment.
Spring Boot 4 decomposes the 2 MiB spring-boot-autoconfigure jar into dozens of technology-specific modules, moving package paths from org.springframework.boot.autoconfigure.* to org.springframework.boot.<technology>.autoconfigure.*. The upgrade hits hard because startup succeeds without errors, but auto-configurations that rely on conditional class matching simply back off silently. The most common casualty is Flyway: including only flyway-core no longer triggers the Flyway auto-configuration; you must explicitly add spring-boot-starter-flyway. Similar pitfalls include string-based spring.autoconfigure.exclude entries that silently stop matching, a transitive Jackson 3 conflict with legacy com.fasterxml.jackson, and version mediation drifting because the tree's depth changed.
The article details a three-step diagnostic routine: dependency:tree -Dverbose to see which module pulls what, dependency:analyze to catch used-undeclared dependencies, and the --debug condition report (plus /actuator/conditions) to confirm whether a bean was actually created. It then prescribes engineering guards: diff the dependency tree before and after upgrade as a baseline gate, use Enforcer rules (requireUpperBoundDeps, dependencyConvergence, bannedDependencies) to kill version drift and old coordinates, add ArchUnit tests to ban stale package references, and implement a startup self-check that throws if required beans are missing. For custom starter authors, separate the autoconfigure and starter artifacts, use afterName/beforeName string soft references instead of Class literals, and avoid hard compatibility across Boot 3 and 4. The migration roadmap recommends upgrading through 3.5 first, using spring-boot-starter-classic as a transitional crutch, and then trimming modules one by one.
The silent backoff of @ConditionalOnClass means that modularizing auto-configuration turns a library upgrade into a behavior change that only surfaces at runtime, placing the burden on developers to validate bean presence explicitly.
Teams that treat the dependency tree as a diffable and gateable artifact will have a smoother migration; the tree becomes an explicit contract rather than an incidental outcome.
The reliance on string-based excludes and package moves creates a class of bugs that compile fine but break production, so migration work must include scans and architecture tests to catch stale package references.
The split pushes dependency management back to build tools; developers must now declare intent at the starter level rather than enjoying transitive convenience.