diff --git a/resilience/README.md b/resilience/README.md index dbbfc80..c17c8f0 100644 --- a/resilience/README.md +++ b/resilience/README.md @@ -48,6 +48,7 @@ All of these are diagnostics for the article. Delete [`DemoController`](src/main 5. [Retry and transactions](docs/05-retry-and-transactions.md) 6. [What is left for Resilience4j](docs/06-what-is-left-for-resilience4j.md) 7. [Migrating from spring-retry](docs/07-migrating-from-spring-retry.md) +8. [`spring-boot-starter-aop` was renamed, not removed](docs/08-starter-aop-renamed-to-starter-aspectj.md) - also backs the sibling post [Resilience4j Circuit Breaker in Spring Boot 4.1](https://ankurm.com/resilience4j-circuit-breaker-spring-boot/) ## Findings worth the trip diff --git a/resilience/broken-example/pom.xml b/resilience/broken-example/pom.xml new file mode 100644 index 0000000..66c9afa --- /dev/null +++ b/resilience/broken-example/pom.xml @@ -0,0 +1,24 @@ + + + + 4.0.0 + + org.springframework.boot + spring-boot-starter-parent + 4.1.1 + + + com.ankurm + break-demo + 1.0.0 + + + + org.springframework.boot + spring-boot-starter-aop + + + diff --git a/resilience/docs/07-migrating-from-spring-retry.md b/resilience/docs/07-migrating-from-spring-retry.md index 3580b2b..5673227 100644 --- a/resilience/docs/07-migrating-from-spring-retry.md +++ b/resilience/docs/07-migrating-from-spring-retry.md @@ -1,6 +1,6 @@ # 7. Migrating from spring-retry -[← 6. What is left for Resilience4j](06-what-is-left-for-resilience4j.md) · [Index](../README.md) +[← 6. What is left for Resilience4j](06-what-is-left-for-resilience4j.md) · [Index](../README.md) · [8. Starter rename: aop → aspectj →](08-starter-aop-renamed-to-starter-aspectj.md) The spring-retry README now says the project "is no longer maintained as an open-source project" and "has been superseded by Spring Framework 7". Its last release on Maven Central is 2.0.13. diff --git a/resilience/docs/08-starter-aop-renamed-to-starter-aspectj.md b/resilience/docs/08-starter-aop-renamed-to-starter-aspectj.md new file mode 100644 index 0000000..955b850 --- /dev/null +++ b/resilience/docs/08-starter-aop-renamed-to-starter-aspectj.md @@ -0,0 +1,59 @@ +← [What is left for Resilience4j](06-what-is-left-for-resilience4j.md) | [Migrating from spring-retry](07-migrating-from-spring-retry.md) → + +# `spring-boot-starter-aop` was renamed, not removed + +Every pre-Boot-4 AOP or Resilience4j guide tells you to add `spring-boot-starter-aop` when an +annotation (`@Retryable`, `@ConcurrencyLimit`, Resilience4j's `@CircuitBreaker`, plain `@Aspect` +beans, anything proxy-based) needs AspectJ on the classpath. On Boot 4.1, adding that dependency +breaks the build before the application ever starts: + +``` +[ERROR] 'dependencies.dependency.version' for org.springframework.boot:spring-boot-starter-aop:jar is missing. +``` + +Captured by [`scripts/reproduce-starter-aop-break.sh`](../scripts/reproduce-starter-aop-break.sh) +against the minimal [`broken-example/pom.xml`](../broken-example/pom.xml), which adds only that +one dependency: [`00a-starter-aop-build-error.txt`](output/00a-starter-aop-build-error.txt). + +## It was renamed, not dropped + +It is tempting to read that error as "the starter is gone, assemble `spring-aop` and +`aspectjweaver` by hand instead" -- an earlier version of the sibling post this repo also serves +said exactly that. It is half right and half wrong. Maven Central's `maven-metadata.xml` for both +artifact IDs, read together, settles it: +[`00b-starter-aspectj-metadata-timeline.txt`](output/00b-starter-aspectj-metadata-timeline.txt). + +`spring-boot-starter-aop`'s last-ever published version is `4.0.0-M2`. `spring-boot-starter-aspectj`'s +first-ever published version is `4.0.0-M3` -- the very next milestone in the same 4.0 line, and it +carries straight through to the 4.0.0 GA and every 4.1.x release since. That is a rename at a +specific milestone boundary, not an unrelated new artifact and not a starter dropped with nothing +replacing it. + +The renamed starter's own published POM confirms it bundles exactly the two jars this module's +`pom.xml` needs: +[`00c-starter-aspectj-pom-dependencies.txt`](output/00c-starter-aspectj-pom-dependencies.txt). + +```xml + + org.springframework.boot + spring-boot-starter-aspectj + +``` + +is all this module adds (see [`pom.xml`](../pom.xml)) -- one line, version-managed by the parent +POM like any other starter, resolving to `spring-aop` + `aspectjweaver` underneath. Assembling +those two dependencies by hand still works and behaves identically, since it's what the starter +does anyway, but there's no longer a reason to: the starter has the same name shape as every +other Boot starter, it's just spelled `aspectj` instead of `aop` from the 4.0 line onward. + +
If you're on a build that still references spring-boot-starter-aop after +upgrading to Boot 4, the fix is a rename in your pom.xml, not a rewrite: swap the +artifactId to spring-boot-starter-aspectj and nothing else changes.
+ +## Going deeper + +- [`pom.xml`](../pom.xml) -- this module's own dependency, with the corrected comment +- Maven Central: [`spring-boot-starter-aop/maven-metadata.xml`](https://repo1.maven.org/maven2/org/springframework/boot/spring-boot-starter-aop/maven-metadata.xml) and [`spring-boot-starter-aspectj/maven-metadata.xml`](https://repo1.maven.org/maven2/org/springframework/boot/spring-boot-starter-aspectj/maven-metadata.xml) -- rel="nofollow" +- [Resilience4j Circuit Breaker in Spring Boot 4.1: What It's Still For](https://ankurm.com/resilience4j-circuit-breaker-spring-boot/) -- the sibling post this same correction applies to + +← [What is left for Resilience4j](06-what-is-left-for-resilience4j.md) | [Migrating from spring-retry](07-migrating-from-spring-retry.md) → diff --git a/resilience/docs/output/00a-starter-aop-build-error.txt b/resilience/docs/output/00a-starter-aop-build-error.txt new file mode 100644 index 0000000..1c73674 --- /dev/null +++ b/resilience/docs/output/00a-starter-aop-build-error.txt @@ -0,0 +1,13 @@ +[ERROR] [ERROR] Some problems were encountered while processing the POMs: +[ERROR] 'dependencies.dependency.version' for org.springframework.boot:spring-boot-starter-aop:jar is missing. @ line 19, column 17 + @ +[ERROR] The build could not read 1 project -> [Help 1] +[ERROR] +[ERROR] The project com.ankurm:break-demo:1.0.0 (/home/claude/work/repos/spring-boot-demo-migration/resilience/broken-example/pom.xml) has 1 error +[ERROR] 'dependencies.dependency.version' for org.springframework.boot:spring-boot-starter-aop:jar is missing. @ line 19, column 17 +[ERROR] +[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. +[ERROR] Re-run Maven using the -X switch to enable full debug logging. +[ERROR] +[ERROR] For more information about the errors and possible solutions, please read the following articles: +[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/ProjectBuildingException diff --git a/resilience/docs/output/00b-starter-aspectj-metadata-timeline.txt b/resilience/docs/output/00b-starter-aspectj-metadata-timeline.txt new file mode 100644 index 0000000..85f537f --- /dev/null +++ b/resilience/docs/output/00b-starter-aspectj-metadata-timeline.txt @@ -0,0 +1,33 @@ +Captured 2026-09-18 from repo1.maven.org (Maven Central), not an aggregator or blog. + +--- org/springframework/boot/spring-boot-starter-aop/maven-metadata.xml --- +4.0.0-M2 +4.0.0-M2 +... version list ends at: + 3.5.16 + 4.0.0-M1 + 4.0.0-M2 + +20260625105758 + +--- org/springframework/boot/spring-boot-starter-aspectj/maven-metadata.xml --- +4.2.0-M1 +4.2.0-M1 +... version list starts at: + 4.0.0-M3 + 4.0.0-RC1 + 4.0.0-RC2 + 4.0.0 + 4.0.1 + ... + 4.1.0 + 4.1.1 + 4.2.0-M1 + +20260820133928 + +Reading the two lists together: spring-boot-starter-aop's last-ever release is 4.0.0-M2. +spring-boot-starter-aspectj's first-ever release is 4.0.0-M3 -- the very next milestone in the +4.0 line. It then carries through 4.0.0-RC1, RC2, the 4.0.0 GA, every 4.0.x and 4.1.x patch, and +into the 4.2.0-M1 pre-release. That is a rename at a specific milestone boundary, not two +unrelated artifacts and not a starter that was dropped with nothing replacing it. diff --git a/resilience/docs/output/00c-starter-aspectj-pom-dependencies.txt b/resilience/docs/output/00c-starter-aspectj-pom-dependencies.txt new file mode 100644 index 0000000..b524fe0 --- /dev/null +++ b/resilience/docs/output/00c-starter-aspectj-pom-dependencies.txt @@ -0,0 +1,35 @@ +Captured 2026-09-18 from repo1.maven.org (Maven Central): +https://repo1.maven.org/maven2/org/springframework/boot/spring-boot-starter-aspectj/4.1.1/spring-boot-starter-aspectj-4.1.1.pom + +org.springframework.boot +spring-boot-starter-aspectj +4.1.1 +spring-boot-starter-aspectj +Starter for using aspect-oriented programming with AspectJ + + + + org.springframework.boot + spring-boot-starter + 4.1.1 + compile + + + org.springframework + spring-aop + 7.0.9 + compile + + + org.aspectj + aspectjweaver + 1.9.25.1 + compile + + + +The renamed starter's own POM declares exactly spring-aop + aspectjweaver as compile +dependencies -- the same two jars this module's own pom.xml already lists as the reason it +depends on spring-boot-starter-aspectj. There is no missing third piece and no behavioural +difference from assembling the two jars by hand; the starter just does it for you, correctly +versioned, in one line. diff --git a/resilience/pom.xml b/resilience/pom.xml index c39ed67..6894b16 100644 --- a/resilience/pom.xml +++ b/resilience/pom.xml @@ -48,7 +48,10 @@ + Boot 4 renamed spring-boot-starter-aop to spring-boot-starter-aspectj (confirmed against + Maven Central's maven-metadata.xml for both artifact IDs and the renamed starter's own + published POM, which depends on exactly spring-aop + aspectjweaver, the two jars this + file used to add by hand before that was verified). See docs/08-starter-aop-renamed-to-starter-aspectj.md. --> io.github.resilience4j resilience4j-spring-boot4 diff --git a/resilience/scripts/reproduce-starter-aop-break.sh b/resilience/scripts/reproduce-starter-aop-break.sh new file mode 100755 index 0000000..79ed570 --- /dev/null +++ b/resilience/scripts/reproduce-starter-aop-break.sh @@ -0,0 +1,9 @@ +#!/usr/bin/env bash +# Reproduces, and captures, the real build error from adding spring-boot-starter-aop on +# Spring Boot 4.1 -- the dependency every pre-Boot-4 Resilience4j / AOP guide tells you to add. +# See docs/08-starter-aop-renamed-to-starter-aspectj.md. +set -uo pipefail +cd "$(dirname "$0")/../broken-example" +mvn -B -q compile 2>&1 | grep -v '^Picked up\|^WARNING' > ../docs/output/00a-starter-aop-build-error.txt +echo "captured to docs/output/00a-starter-aop-build-error.txt:" +cat ../docs/output/00a-starter-aop-build-error.txt