configuration-properties/ @ConfigurationProperties vs @Value on Spring Boot 4.1.1. The relaxed-binding matrix is generated by binding each spelling rather than transcribed, and re-checked against real processes -- the in-process probe was wrong twice before it was right. Records the three findings that came out of it: @Value does get relaxed resolution inside Spring Boot (Boot attaches ConfigurationPropertySources), the configuration processor silently stops generating metadata on JDK 23+ when declared as a plain dependency, and @Valid is not what makes nested constraints run. profiles-and-config/ Precedence, profiles, spring.config.import and config trees. /precedence reports every source holding a property in rank order with file and line, which turns "my profile file had no effect" into a two-line answer. Also pins the counterintuitive one: an imported file outranks the file that imported it. spring-aop/ Designators, proxy types, and aspects that do not fire. One advice per supported designator so the reference table is generated from real matches; all fourteen unsupported designators fed to the parser. Two corrections to the reference documentation: unsupported designators throw UnsupportedPointcutPrimitiveException (extends RuntimeException, not IllegalArgumentException), and spring-boot-starter-aop was renamed to spring-boot-starter-aspectj in Boot 4. 19 contract tests across the three modules, 15 captured transcripts, all regenerated by scripts/run-all.sh. Verified on Spring Boot 4.1.1, Spring Framework 7.0.9, JDK 25.0.4.1. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Gip4srpzMwjgoba6uEfbr5
68 lines
2.7 KiB
Markdown
68 lines
2.7 KiB
Markdown
# Spring AOP: designators, proxies, and aspects that do not fire
|
|
|
|
Companion project for [**Spring AOP Explained**](https://ankurm.com/) on ankurm.com.
|
|
|
|
Two halves. One set of aspects that work — one advice per pointcut designator, so the reference
|
|
table is generated from real matches. One set that does not fire, each for a different reason,
|
|
each paired with its fix.
|
|
|
|
## Versions
|
|
|
|
| | |
|
|
|---|---|
|
|
| Spring Boot | 4.1.1 |
|
|
| Spring Framework | 7.0.9 |
|
|
| AspectJ weaver | 1.9.25.1 |
|
|
| JDK | Eclipse Temurin 25.0.4.1 (LTS) |
|
|
|
|
## Read this before copying a dependency block
|
|
|
|
In Spring Boot 3 the starter was `spring-boot-starter-aop`. In Spring Boot 4 it is
|
|
**`spring-boot-starter-aspectj`**. The old artifact's last publication is `4.0.0-M2` and its
|
|
last GA is `3.5.16`, so a pre-4 dependency block fails resolution with a missing-version error.
|
|
|
|
## Quickstart
|
|
|
|
```bash
|
|
export JAVA_HOME=/path/to/jdk-25
|
|
mvn -DskipTests package
|
|
./scripts/run-all.sh # regenerate every transcript in docs/output/
|
|
mvn test # 6 contract tests
|
|
```
|
|
|
|
## Endpoints
|
|
|
|
| Endpoint | Purpose |
|
|
|---|---|
|
|
| `GET /aop/proxies` | per bean: proxied or not, which kind, and the advisor list |
|
|
| `GET /aop/designators` | exercises every advised method, reports what each designator matched |
|
|
| `GET /aop/parser` | feeds supported and unsupported expressions to the pointcut parser |
|
|
| `GET /aop/broken` | runs the failure gallery and reports that nothing fired |
|
|
|
|
## Documentation
|
|
|
|
1. [What Spring AOP actually is](docs/01-what-spring-aop-is.md)
|
|
2. [The designator reference](docs/02-designators.md)
|
|
3. [JDK dynamic proxies and CGLIB](docs/03-proxy-types.md)
|
|
4. [Advice types and ordering](docs/04-advice-types.md)
|
|
5. [Six aspects that do not fire](docs/05-broken-aspect-gallery.md)
|
|
6. [Diagnosing a silent aspect](docs/06-diagnosing-a-silent-aspect.md)
|
|
|
|
## Captured output
|
|
|
|
| File | Produced by |
|
|
|---|---|
|
|
| [`00-versions.txt`](docs/output/00-versions.txt) | `scripts/demo-versions.sh` |
|
|
| [`01-designators.txt`](docs/output/01-designators.txt) | `scripts/demo-designators.sh` |
|
|
| [`02-proxy-types.txt`](docs/output/02-proxy-types.txt) | `scripts/demo-proxy-types.sh` |
|
|
| [`03-broken-gallery.txt`](docs/output/03-broken-gallery.txt) | `scripts/demo-broken-gallery.sh` |
|
|
|
|
## Two corrections to the reference documentation
|
|
|
|
- Unsupported designators throw **`UnsupportedPointcutPrimitiveException`**, which extends
|
|
`RuntimeException` directly — not `IllegalArgumentException` as the docs state. Catching the
|
|
documented type will not catch it.
|
|
- The framework default is interface-based proxying, but **Spring Boot sets
|
|
`proxy-target-class=true`**, so you get CGLIB even for beans that implement interfaces. That
|
|
changes which designators match; `scripts/demo-proxy-types.sh` shows both.
|