跪拜 Guibai
← Back to the summary

Spring Boot 4's Autoconfig Split Silently Breaks Flyway: A Field Guide to Surviving the Dependency Tree Overhaul

After Spring Boot 4 Split Auto-configuration into 47 Modules, My dependency:tree Went Wild: A Complete Field Guide from Diagnosis to Governance

Last week, when I upgraded our team's mid-platform project from Spring Boot 3.5 to 4.0, a diff of mvn dependency:tree turned the whole screen red. More thrillingly: the service started normally without any errors, but Flyway scripts never ran — we only discovered it before production release. This article thoroughly explains the context of Boot 4's modularization, the real pitfalls that will blow up, the combination of diagnostic techniques, and the engineering safety nets, suitable for those planning to upgrade or those who have just been "backstabbed" by the dependency tree.


1. First Understand: Why Did the Tree Change?

Many people's first reaction to a changed tree is "my dependencies are broken." In fact, the opposite is true — the tree changing is not a problem; it's an intentional architectural change in Boot 4.

From "All-You-Can-Eat Buffet" to "Order per Dish"

Look at the expansion history of spring-boot-autoconfigure:

1.0 (2014) ---- about 182 KB    compact
3.5 (2025) ---- about 2 MiB    giant: 200+ auto-configuration classes for Web/JPA/Kafka/Redis/Mail all packed in one jar
4.0 (2025.11 GA) ---- split into dozens of focused modules by technology domain

In the Boot 3.5 era, if you included spring-boot-starter-web, the 2MB giant jar carried JPA, Mongo, Batch, Kafka auto-configuration classes simultaneously. Even if you didn't use Redis, its auto-configuration class was still on your classpath, only filtered at runtime by @ConditionalOnClass.

Boot 4 (based on Spring Framework 7 / Jakarta EE 11) takes a different approach: instead of filtering at runtime, don't bring them in at dependency time.

image.png

The following table aligns the core differences between the two versions:

Dimension Boot 3.5 Boot 4.0
Auto-configuration carrier spring-boot-autoconfigure monolithic spring-boot-<technology> split by technology
Package path org.springframework.boot.autoconfigure.* org.springframework.boot.<technology>.autoconfigure.*
Registration list one full AutoConfiguration.imports file name unchanged, one becomes N copies, each module jar has its own
Web Starter spring-boot-starter-web spring-boot-starter-webmvc
Test support spring-boot-starter-test all-in-one each technology has *-test, e.g., spring-boot-starter-webmvc-test
Flyway / Liquibase adding just the core library auto-configures it must explicitly add the corresponding starter
Embedded container Tomcat 10 / Jetty 11 / Undertow Tomcat 11 / Jetty 12, Undertow removed (incompatible with Servlet 6.1)
JSON Jackson 2.x (com.fasterxml.jackson) Jackson 3.x (tools.jackson)
Test framework compatible with JUnit 4 JUnit 4 removed; @MockBean removed, use @MockitoBean

Module naming basically follows three rules:

First, correct two misconceptions: One, don't memorize the number "47" — that's the community's count of split modules (some say 47, some say 70+). The official wording is "split into multiple focused modules". Refer to the 4.0.x migration guide for your locked version. Two, splitting into dozens of modules does not mean you must manually import dozens of dependencies — starters remain aggregation facades, and spring-boot-starter-webmvc will bring in the fine-grained modules you need. Also, the JDK baseline is still 17, so you don't need to upgrade the JDK first, lowering the migration barrier.

What Do We Get from Splitting?

The benefits are real. Measured data from community production migrations: image size reduced about 19%, startup time dropped from 4.2 seconds to 2.8 seconds (about 33%).

Technical highlight: Why is startup faster? Boot's conditional assembly first filters by not loading bytecode — OnClassCondition reads compile-time metadata via ASM, eliminating a large number of candidates. After modularization, the number of candidate configuration classes that need conditional filtering on the classpath is directly halved, so the scan and evaluation overhead at each startup drops sharply. The official confirmation is that the split's purpose is maintainability, clarity, and a leaner runtime footprint; startup speedup is a side benefit. It's even better for GraalVM Native Image: previously AOT had to scan and trim unused Kafka, JPA configuration classes, now they're not even brought in, so no trimming needed.

One sentence summary: 3.5 is "pick who doesn't work from a roomful of people", 4.0 is "just don't send a door card to that person" — a shift from runtime fallback to dependency-time governance.


2. What Exactly Changed in the Tree: Four Layers

Based on an actual diff, after the upgrade a batch of new fine-grained jars appear, while some old faces disappear:

+ spring-boot-http-converter-4.0.0.jar
+ spring-boot-jackson-4.0.0.jar
+ spring-boot-jdbc-4.0.0.jar
+ spring-boot-persistence-4.0.0.jar
+ spring-boot-servlet-4.0.0.jar
+ spring-boot-sql-4.0.0.jar
+ spring-boot-tomcat-4.0.0.jar
+ spring-boot-transaction-4.0.0.jar
+ spring-boot-web-server-4.0.0.jar
+ spring-boot-webmvc-4.0.0.jar
+ jspecify-1.0.0.jar
- spring-jcl-6.2.14.jar          # replaced by commons-logging

Attribution: tree change is the result of four things overlapping:

  1. Coordinates changed: spring-boot-starter-web → spring-boot-starter-webmvc, spring-boot-starter-aop → spring-boot-starter-aspectj. GAV changes shift the entire subtree's attachment point.
  2. Granularity changed: autoconfigure goes from 1 jar to N modules, tree changes from "single-rooted and short/fat" to "multi-rooted and tall/thin", primary nodes increase, total leaves decrease.
  3. Dependency chain changed: third-party classes previously "carried in" via transitive dependencies (those you could import and compile against without declaring) are now cut off.
  4. Semantics changed: previously 80% of tree decisions were made by the framework for you; now the tree is leaner but every line is your own signature — dependency is intent. Including only spring-boot-starter-webclient guarantees no accidental Web server startup; no need to manually setWebApplicationType(NONE) anymore.

3. The Real Traps That Will Blow Up (Sorted by Insidiousness)

This section is the most valuable in the whole article — all are true incident scenes where "it compiled, it started, but functionality is gone."

Trap 1: Flyway Dependency Still Exists but Does Not Execute

This is the most typical pitfall in Boot 4 modular migration. In Boot 3.5, many projects only included flyway-core, because auto-configuration was all in the big jar, and auto-assembly would happen when Flyway classes were detected. In Boot 4, having only the third-party core library does not mean the corresponding auto-configuration module exists:

<!-- Boot 3.5: this was enough -->
<dependency>
    <groupId>org.flywaydb</groupId>
    <artifactId>flyway-core</artifactId>
</dependency>

<!-- Boot 4: must complete with the matching technology starter -->
<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-flyway</artifactId>
</dependency>

For web projects, adjust accordingly:

<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-webmvc</artifactId>
</dependency>

Why doesn't startup fail? @ConditionalOnClass uses ASM bytecode reading; when the condition is not met it silently backs off — no exception, no log, the functionality disappears. H2 Console not opening, an actuator endpoint missing, JSON serialization behavior subtly changing — all this pattern. The failure point is far from the root cause, making this the hardest type of problem to diagnose after modularization.

Core conclusion: Boot 4 does not reduce auto-configuration, it simply stops giving it away for free with the big jar. Whatever capability you want, you must explicitly bring the corresponding starter into the classpath. Don't hope for "luck" from third-party transitive dependencies to trigger auto-assembly.

Trap 2: exclude Silently Fails — The Most Insidious Cut

In the 3.x era, we used spring.autoconfigure.exclude in config files to exclude auto-configuration, which was pure string matching. In Boot 4, these classes' package paths have all moved (org.springframework.boot.autoconfigure.jdbc.* → org.springframework.boot.jdbc.autoconfigure.*). Config files don't validate strings, so the exclusion silently fails, and the auto-configuration you excluded comes back to life.

// Bad: 3.5 style — class moved, compile-time fails, but string exclude in config file can't detect it
@SpringBootApplication(exclude = DataSourceAutoConfiguration.class)

// Good: 4.0 — use the new package path; or more thoroughly, don't include the corresponding starter at all, do dependency-level trimming
@SpringBootApplication(exclude = {
    org.springframework.boot.jdbc.autoconfigure.DataSourceAutoConfiguration.class
})

Practical advice: During migration, globally search config files for spring.autoconfigure.exclude, check each against the new package name; a more elegant approach is to change your thinking — the best exclude in Boot 4 is not including the corresponding starter. Similarly, review all <exclusion> entries in your pom for artifact coordinates; many people are excluding old artifact coordinates, effectively excluding nothing. My approach is to clear all exclusions and re-add each one with a comment explaining why.

Trap 3: Dual Jackson Coexistence — More Prone to Production Incidents Than the Autoconfigure Split

Boot 4 defaults to Jackson 3, with groupId and package name tools.jackson. But your old SDKs and older third-party libraries likely still bring com.fasterxml.jackson transitively — both Jackson generations exist in the tree, double serializers, ClassCastException, JSON behavior inconsistency: insidious and fatal.

Handling directions:

Trap 4: Version Mediation Secretly Drifts

This trap explains even "I didn't change any version numbers, yet the jar version changed." The depth of the tree changes, so Maven's nearest-wins (shortest path first) mediation results drift; worse, Gradle uses highest-wins, the same project can resolve differently under the two build tools.

The only solution: hand all versions to the spring-boot-dependencies BOM, and sub-modules use bare coordinates, never manually write versions, then use Enforcer's requireUpperBoundDeps / dependencyConvergence to lock down divergence.

Trap 5: Test Infrastructure Falls Apart

Test infrastructure is also modularized:

Trap 6: Hard Thresholds in Container and Build Chains


4. Diagnostic Combo: Three Quick Checks, Conclusion in Five Minutes

When you encounter "behavior is wrong after upgrade", don't start cutting exclusion randomly. My diagnostic path is fixed:

image.png

Each of the three checks covers a separate segment:

# 1) See which Boot module comes from which dependency path (-Dverbose shows omitted for conflict)
./mvnw dependency:tree -Dverbose "-Dincludes=org.springframework.boot:*"

# Focus on the technology you suspect
mvn dependency:tree -Dincludes=org.springframework.boot:spring-boot-*jpa*

# Reverse-lookup which third-party jar pulled in something
mvn dependency:tree -Dincludes=tools.jackson.core:jackson-databind

# 2) Static analysis: find "used but not declared" freeloader dependencies
./mvnw dependency:analyze

# 3) See the real runtime assembly results, no guessing
java -jar app.jar --debug 2>&1 | grep -E 'matched|Did not match'
curl -s localhost:8080/actuator/conditions | jq '.contexts[].positiveMatches | keys'

The Gradle equivalent:

./gradlew dependencyInsight --dependency spring-boot-autoconfigure --configuration runtimeClasspath

For hunting down ClassNotFoundException or shadow classes, directly inspect the actual runtime loading order: java -verbose:class -jar app.jar | grep -i AutoConfiguration.

Know the capability boundaries of the three tools:

Tool Answers which question Limitation
dependency:tree Is the module present? Who brought it in? cannot prove whether a bean was created
dependency:analyze Are there undeclared dependencies in static bytecode? can't identify runtime auto-assembly
--debug condition report Did auto-configuration match? Which condition is missing? when the auto-config class is not on the classpath, you must add the module first

One-sentence cheat code:

dependency:tree tells you "is the class there"
        |
Condition Report tells you "did the condition pass"
        |
Integration tests tell you "was the bean actually created"

The condition report will tell you directly: is @ConditionalOnClass not satisfied (add modules), or does @ConditionalOnMissingBean back off because of your own bean (by design), or was it excluded by spring.autoconfigure.exclude (check config).


5. A "Anti-Demolition" Rebuild of Custom Starters

If your company maintains internal starters, copy this section directly.

Separation of Responsibilities + Minimal Skeleton

The official recommendation for library authors is clear: separate autoconfigure module and starter module. The former contains @AutoConfiguration, conditional beans, @ConfigurationProperties; the latter only does dependency aggregation:

// acme-spring-boot-autoconfigure module
@AutoConfiguration(
    // cross-module ordering uses fully-qualified name strings, no compile-time dependency
    afterName  = "org.springframework.boot.jdbc.autoconfigure.DataSourceAutoConfiguration",
    beforeName = "org.springframework.boot.webmvc.autoconfigure.WebMvcAutoConfiguration"
)
// name form: if class absent, gracefully backs off, never ClassNotFoundException
@ConditionalOnClass(name = "org.springframework.web.servlet.DispatcherServlet")
@EnableConfigurationProperties(AcmeProperties.class)
public class AcmeAutoConfiguration {

    @Bean
    @ConditionalOnMissingBean   // always leave an override for the business side
    public AcmeClient acmeClient(AcmeProperties props) {
        return new AcmeClient(props.getEndpoint(), props.getTimeout());
    }
}

The registration list file location stays the same, but write only your own class, never copy third-party AutoConfigurations in:

# src/main/resources/META-INF/spring/
#   org.springframework.boot.autoconfigure.AutoConfiguration.imports
# one FQCN per line
com.acme.autoconfigure.AcmeAutoConfiguration

The starter module only does aggregation, all versions to the BOM:

<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-autoconfigure</artifactId> <!-- only for skeleton annotations -->
</dependency>
<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-jackson</artifactId>
    <optional>true</optional>  <!-- the consumer's starter decides what to include -->
</dependency>
<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-webmvc</artifactId>
    <optional>true</optional>
</dependency>

Technical highlight: the most technical move is using afterName / beforeName string soft references instead of .class hard references. After splitting, the class you need to order against may not be on the consumer's classpath — writing a Class literal would fail to compile or throw NoClassDefFoundError, while writing a string means "if the other module is not imported, the ordering declaration is simply ignored." Essence: downgrade compile-time coupling to runtime condition, so others can relocate and you don't recompile. Also, don't be led astray by old tutorials: spring.factories registration of EnableAutoConfiguration is gone since Boot 3.0; the real trap in 4.0 is that class names in old imports files all moved, and when ImportCandidates merges, it can't find the class, so it silently doesn't assemble.

Two Iron Rules

  1. Do not try to be compatible with both Boot 3 and Boot 4 in the same artifact. Package structure changed, dependency baselines differ; forcing them into one jar inevitably causes classpath ambiguity. Officially recommended: publish separate artifacts per major version — your internal starter has two version lines (2.x for Boot 3, 3.x for Boot 4), maintenance cost is far lower than the landmines from hard compatibility.
  2. When compile-time needs Boot base classes, declare them as compileOnly / optional, runtime is provided by the consumer's starter, don't bring the entire old autoconfigure fat jar in — otherwise version mediation is instantly invalidated.

If your starter also runs on Native Image, add AOT hints. After aligning conditions and modules, AOT will just cut it out when the corresponding slice isn't imported:

@AutoConfiguration
@ConditionalOnClass(name = "io.lettuce.core.RedisClient") // no redis slice imported → AOT cuts it
@ImportRuntimeHints(TinyRedisHints.class)
public class TinyRedisAutoConfiguration {

    @Bean
    @ConditionalOnMissingBean
    RedisProbe redisProbe() { return new RedisProbe(); }
}

class TinyRedisHints implements RuntimeHintsRegistrar {
    @Override
    public void registerHints(RuntimeHints hints, ClassLoader cl) {
        hints.reflection()
             .registerType(RedisProbe.class, MemberCategory.INVOKE_PUBLIC_METHODS);
    }
}

6. Engineering Guards: Treat the Dependency Tree as a Contract with Regression

Single-point troubleshooting solves one problem; engineering solves a class of problems. This section is what I consider the best solution for both this problem and real practice — turning "the tree changed" from superstition into a reviewable, gated, rollbackable engineering action.

6.1 Dependency Baseline Diff: Take a "X-Ray" of the Tree Before Upgrading

# Archive before upgrade — naked upgrade = naked production
mvn dependency:tree -DoutputFile=tree-3.5.txt
# Take another after upgrade, coordinate-level diff (strip version and hierarchy noise)
mvn dependency:tree -DoutputFile=tree-4.0.txt

awk -F'[: ]+' '{print $2":"$3}' tree-3.5.txt | sort -u > g35.txt
awk -F'[: ]+' '{print $2":"$3}' tree-4.0.txt | sort -u > g40.txt
diff -u g35.txt g40.txt | less

If you want to draw a graph for your boss: mvn dependency:tree -DoutputType=dot -DoutputFile=tree.dot && dot -Tsvg tree.dot -o tree.svg.

Go further: lock the 3.5 tree into the repository as a baseline, require the upgrade PR to include the diff, and have CI enforce it:

#!/usr/bin/env python3
# tree_diff.py — upgrade gate: turn "tree changed" into a reviewable checklist
import re, sys

def boot_coords(path):
    return {f"{g}:{a}" for g, a in re.findall(
        r"(org.springframework.boot):([\w-]+):", open(path).read())}

old, new = boot_coords("tree-3.txt"), boot_coords("tree-4.txt")
print("new:", *sorted(new - old), sep="\n  ")
print("gone/split:", *sorted(old - new), sep="\n  ")
print("still present but needs manual confirmation:", *sorted(old & new), sep="\n  ")
# if 3.x leftover coordinates appear, exit non-zero to block the "half-new half-old" tree
sys.exit(1 if any("autoconfigure" in c for c in old & new) else 0)

A more general approach in CI is to validate the entire runtime dependency baseline — not to forbid changes, but to forbid silent changes:

#!/usr/bin/env bash
# deps-gate.sh — dependency changes in a PR must be "visible"
set -euo pipefail
mvn -q dependency:list -DincludeScope=runtime \
    -DoutputFile=target/deps-now.txt -Dsort=true
grep -oE '[a-zA-Z0-9._-]+:[a-zA-Z0-9._-]+:[a-z]+:[^ ]+' \
    target/deps-now.txt | sort -u > target/now.gav

if ! diff -u baseline/deps.gav target/now.gav > target/deps.diff; then
  echo "Runtime dependencies changed, please explain in the PR:"
  cat target/deps.diff
  exit 1
fi
echo "Dependency baseline consistent"

6.2 Enforcer: Prevent "Half-New Half-Old", Kill Version Drift

<plugin>
  <groupId>org.apache.maven.plugins</groupId>
  <artifactId>maven-enforcer-plugin</artifactId>
  <executions><execution>
    <id>boot4-guard</id>
    <goals><goal>enforce</goal></goals>
    <configuration><rules>
      <!-- all 47 modules' versions must converge, no hand-written versions -->
      <requireUpperBoundDeps/>
      <dependencyConvergence/>
      <bannedDependencies>
        <excludes>
          <!-- third-party starters in the compatibility gap may bring back 3.x fat jar → build fails -->
          <exclude>org.springframework.boot:spring-boot-autoconfigure:[3.0,4.0)</exclude>
          <!-- Boot 4 removed Undertow -->
          <exclude>io.undertow:*</exclude>
          <!-- prevent Jackson 2 from sneaking back in from old SDKs and coexisting with Jackson 3 -->
          <exclude>com.fasterxml.jackson.core:jackson-databind</exclude>
        </excludes>
        <searchTransitive>true</searchTransitive>
      </bannedDependencies>
    </rules></configuration>
  </execution></executions>
</plugin>

Also hook dependency:analyze into the pipeline so "freeloader transitive dependencies" never enter the main branch:

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-dependency-plugin</artifactId>
    <executions>
        <execution>
            <id>analyze-deps</id>
            <phase>verify</phase>
            <goals><goal>analyze-only</goal></goals>
            <configuration>
                <failOnWarning>true</failOnWarning> <!-- used-undeclared turns red -->
            </configuration>
        </execution>
    </executions>
</plugin>

dependency:analyze reports Used undeclared dependencies (e.g., you use commons-lang3 in code but don't declare it, relying on the 3.5 transitive chain). Declare each explicitly — that's the root fix.

6.3 ArchUnit: Scan Source for "Old Addresses"

Manual grep always misses something; write the rules as tests:

@Test
void no_reference_to_old_autoconfigure_packages() {
    noClasses().that().resideInAPackage("com.acme..")
        .should().dependOnClassesThat()
        .resideInAPackage("org.springframework.boot.autoconfigure.web..")
        .because("Boot 4 moved to org.springframework.boot.webmvc.autoconfigure")
        .check(new ClassFileImporter().importPackages("com.acme"));
}

6.4 Startup Self-Check: Turn "Silent Under-Assembly" into Fail-Fast

This is the layer that saves you. The scariest part of splitting is not the error; it's turning an explicit error into silent degradation. So the principle is: rather fail startup than ship with a missing bean.

// pure Spring Framework API, unaffected by Boot 4 package moves
public class RequiredBeansInitializer
        implements ApplicationContextInitializer<ConfigurableApplicationContext> {

    private static final List<String> MUST_HAVE =
        List.of("entityManagerFactory", "transactionManager", "flyway"); // adjust per service

    @Override
    public void initialize(ConfigurableApplicationContext ctx) {
        ctx.addApplicationListener((ApplicationListener<ContextRefreshedEvent>) e -> {
            List<String> missing = MUST_HAVE.stream()
                .filter(n -> !e.getApplicationContext().containsBean(n)).toList();
            if (!missing.isEmpty()) {
                throw new IllegalStateException(
                    "Silent under-assembly after modularization: " + missing + " → check missing starter / accidental classic usage");
            }
        });
    }
}
// registration: new SpringApplicationBuilder(App.class)
//          .initializers(new RequiredBeansInitializer()).run(args);

On the test side, add two "mirror-up" tests. Smoke tests should not just verify "the service can start"; verify that the key auto-configuration actually took effect:

@SpringBootTest
class FlywayAutoConfigurationSmokeTest {

    @Autowired
    private ApplicationContext context;

    @Test
    void shouldCreateFlywayBean() {
        Flyway flyway = context.getBeanProvider(Flyway.class).getIfAvailable();
        assertThat(flyway)
                .as("Flyway auto-configuration module or condition not satisfied")
                .isNotNull();
    }
}

Technical highlight: turn "auto-configuration drift" into a CI-blockable problem, not a database script missed after production.

To verify your own exclude / conditional assembly isn't broken by the split, use ApplicationContextRunner for lightweight unit tests without booting the whole container:

class DataSourceConfigTest {

    private final ApplicationContextRunner runner = new ApplicationContextRunner()
        .withConfiguration(AutoConfigurations.of(DataSourceAutoConfiguration.class));

    @Test
    void shouldBackOffWhenDataSourceExists() {
        runner.withUserConfiguration(ManualDataSourceConfig.class)
              .run(ctx -> assertThat(ctx).hasSingleBean(DataSource.class)
                                        .doesNotHaveBean(DataSourceAutoConfiguration.class));
    }
}

6.5 OpenRewrite: Batch Migration for Hundreds of Modules

Don't manually edit large projects; the official recipe does it:

mvn -U org.openrewrite.maven:rewrite-maven-plugin:run \
  -Drewrite.recipeArtifactCoordinates=org.openrewrite.recipe:rewrite-spring:RELEASE \
  -Drewrite.activeRecipes=org.openrewrite.java.spring.boot3.UpgradeSpringBoot_4_0

7. Migration Roadmap: First Survive, Then Slim Down

If you're about to do it, here's a proven order of operations:

image.png

Several key points:


8. Difficulty Quick-Reference Table

# Difficulty Typical Symptom Solution
1 Implicit dependencies forced to be explicit flyway-core included, tables not created and no error Add spring-boot-starter-<tech>, don't rely on third-party transitive dependencies
2 Transitive dependency cut off NoClassDefFoundError, compiles but crashes at runtime dependency:analyze finds used-undeclared, declare explicitly
3 Starter renamed Could not find artifact web→webmvc, aop→aspectj; consult migration guide or OpenRewrite
4 exclude silently fails excluded auto-config comes back globally search config strings, update package names; prefer "don't include the starter" for dependency-level trimming
5 Package name mass move imports all red; old imports file class names not found → silent no-assembly remember three-part boot.<module>.autoconfigure.*; ArchUnit as backstop
6 Auto-config ordering broken XxxAutoConfiguration.class fails to compile use afterName / beforeName string soft references
7 Test slice missing @WebMvcTest silent, @MockBean error add spring-boot-starter-<tech>-test; switch to @MockitoBean
8 Version mediation drift jar version changed without changing version numbers BOM + requireUpperBoundDeps / dependencyConvergence
9 Dual Jackson coexistence ClassCastException, inconsistent serialization ban com.fasterxml, or use spring-boot-jackson2 transition
10 Undertow can't start container simply gone migrate to Tomcat 11 / Jetty 12, Enforcer blocks old coordinates
11 Classic trap upgraded to 4.0, no faster startup, no slimmer image treat as temporary crutch, replace with precise starters then delete
12 Custom starter compatibility dilemma compiles on one side, crashes on the other publish dual version lines for Boot 3/4, never hard-compatible in one jar
13 Engineering support outdated SBOM / CI cache / Native hints all fail rerun CycloneDX, refresh cache, re-collect AOT

In Closing

After this migration, my deepest feeling is: "the tree is different" is never a bug; "the tree changed but nobody knows what changed" is the bug. Boot 4's split essentially forces the implicit contracts hidden behind conditional annotations in 3.x onto the surface in one go — short-term migration cost, long-term payoff is a smaller classpath, faster startup, cleaner IDE hints, and paving the way for JPMS and GraalVM. The open-source support window for 3.5 is now in countdown; this isn't a "whether to upgrade" question, but "how to upgrade scientifically".

My landing advice in three sentences: starter is the facade, BOM is the contract, dependency tree is the fact; first put dependency baseline diff and Enforcer into CI, then talk about upgrade; rather fail-fast at startup than ship with missing beans.

If you find this pitfall summary useful, feel free to follow me. Next I plan to write a separate article on the more vicious trap of "Jackson 2 → 3 dual-version coexistence causing inconsistent serialization in production."

Finally, a concrete interactive question: Did your team go the classic dual-track transition or OpenRewrite one-shot from 3.5 to 4? Have you implemented dependency whitelist control at CI level? Share your approach in the comments; the highest-voted trap will be my next post.