Add openrewrite module: Boot 2.7 to 3.5 to 4.0 upgrade with OpenRewrite recipes, leftovers and CI gate

Co-Authored-By: Claude Sonnet 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Gth99spB1CzQmBFofXmU4Z
This commit is contained in:
Claude
2026-09-28 08:40:08 +00:00
parent e4f927d7af
commit b4b43b94bf
24 changed files with 559 additions and 0 deletions
+27
View File
@@ -0,0 +1,27 @@
# openrewrite
Companion module for the ankurm.com post *Automating javax → jakarta and Boot 3 → 4 Upgrades with OpenRewrite*.
`legacy-app/` is a small Spring Boot 2.7.18 application (JPA, validation, security, a servlet filter, `RestTemplate`, a JUnit 4 test, a `spring.factories` auto-configuration). `scripts/run-all.sh` copies it to a scratch directory outside this checkout, runs two OpenRewrite recipes in sequence, builds and tests after each, and records everything under `output/`.
| Tool | Version |
|---|---|
| rewrite-maven-plugin | 6.46.1 |
| rewrite-spring | 6.37.1 |
| rewrite-migrate-java | 3.42.1 |
| JDK / Maven | 17 / 3.9 |
```bash
export JAVA_HOME=/path/to/jdk17
./scripts/run-all.sh
```
| Output | Shows |
|---|---|
| `00-gotcha-gitignore.txt` | OpenRewrite silently skips sources that git ignores |
| `01-baseline.txt` | Legacy app builds and passes on Boot 2.7.18 |
| `02-step1-diff.txt` / `03-step1-build.txt` | `UpgradeSpringBoot_3_5`: diff and build |
| `04-step2-diff.txt` / `05-step2-build.txt` | `UpgradeSpringBoot_4_0`: diff and build |
| `06-what-it-left-behind.txt` | What the recipes did not change |
| `07-step3-boot-4.1.1.txt` | Hand bump from 4.0.x to 4.1.1, build and test |
| `08-ci-gate.txt` | `rewrite:dryRun` exit codes, including a property-name trap |