apache/maven · #13009 · Merged Sep 9, 2026
Propagate request traces through derived Maven sessions
Added `Session.withContext(RequestTrace)` and propagated its scoped trace through Maven session derivation, artifact resolution, installation, and deployment.
Build-platform observability feature: Maven integrations can now carry typed request-trace context through derived sessions and Resolver operations without losing nesting or thread isolation.
Resolver requests expose context to listeners, but Maven 4 had no consistent session-level mechanism for establishing and preserving that context. Derived repository sessions, nested operations, and explicit traces could therefore lose attribution or restore the wrong previous trace.
Introduces a typed session derivation API, shares the active trace with Maven sessions backed by the same Resolver session, and restores the exact prior trace after nested or explicit operations. Null traces remove thread-local state, and local or remote repository derivation preserves the scope.
- Gives build extensions and repository listeners reliable context for correlating Resolver activity with the Maven operation that initiated it.
- Carries trace identity across resolution, installation, and deployment instead of limiting observability to one execution path.
- Maintains thread isolation and exact nested restoration for concurrent and scoped build operations.
- Added propagation, nesting, repository derivation, concurrency, null-cleanup, explicit-restoration, install, and deploy regressions; all 21 focused tests passed.
- The full Maven verification build passed. Core IT reported 1,059 passing tests under JDK 26; the two JDK-sensitive failures were rerun under JDK 21 and all four affected test methods passed.
- A Maven maintainer approved the revised null-trace cleanup with no new findings; final PR checks passed and the GitHub-verified merge commit credits Goutam Adwant and closed MNG-8671.
Files and modules
Technologies