Co-Authored-By: Claude Sonnet 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_017ic4b4VQVEJWetTT1dYzyJ
38 lines
2.2 KiB
Markdown
38 lines
2.2 KiB
Markdown
# boot4-migration
|
|
|
|
Companion module for the ankurm.com post
|
|
[Spring Boot 3 to 4 Migration Guide (Updated for 4.1 and 4.2)](https://ankurm.com/spring-boot-3-to-4-migration-guide/).
|
|
|
|
One small service (Web MVC, Security, Actuator, JDBC + Flyway, AOP aspect, `RestClient.Builder`,
|
|
a Jackson serializer, three tests) in two forms:
|
|
|
|
| Directory | What it is | Built by |
|
|
|---|---|---|
|
|
| `before/` | the service on Spring Boot 3.5.16 | never by a normal build; `scripts/run-all.sh` copies it to a scratch dir |
|
|
| `after/` | the same service migrated to Spring Boot 4.1.2 | `cd after && mvn verify` |
|
|
|
|
`run-all.sh` builds `before/` as written, then bumps only the parent version and records what
|
|
breaks at each step: the build error, the javac errors, the start-up failure report, the
|
|
things that start fine but behave differently, and the test failures. Every file in `output/` is
|
|
a real transcript from that script (JDK 25.0.5, Maven 3.9).
|
|
|
|
```bash
|
|
export JAVA_HOME=/path/to/jdk-25
|
|
./scripts/run-all.sh # 15-25 minutes on a shared 2-vCPU box; needs Maven Central
|
|
```
|
|
|
|
| Output | Shows |
|
|
|---|---|
|
|
| `01-before-boot35.txt` | `before/` builds and runs on 3.5.16 (the baseline every other file is compared with) |
|
|
| `02-bump-only-compile-errors.txt` | only the parent version changed: Maven POM error, then 12 javac errors |
|
|
| `03-compiles-but-will-not-start.txt` | imports ported, starters not: compiles, fails at start-up (no `RestClient.Builder`) |
|
|
| `04-starts-but-silently-wrong.txt` | starts, answers 200, but Flyway never ran, logs never rotate |
|
|
| `05-properties-migrator.txt` | what `spring-boot-properties-migrator` does and does not report |
|
|
| `06-after-boot41.txt` | `after/`: 8 tests pass, same endpoints, new health groups |
|
|
| `07-jackson-property-order.txt` | bean property order on Jackson 2, Jackson 3, and `use-jackson2-defaults` |
|
|
| `08-test-compile-errors.txt` | `@MockBean` and the old `@AutoConfigureMockMvc` package |
|
|
| `09-test-runtime-failure.txt` | a plain `@Mock` field is `null`: compiles, fails at run time |
|
|
| `10-security-dsl-compile-errors.txt` | the real javac message for the removed `authorizeHttpRequests()` chain |
|
|
|
|
Not covered: Gradle, Kotlin, native image, and any library that has not shipped a Boot 4 release.
|