Expose repository events through the Maven API
Introduced Maven-owned repository and execution event families, bridged all 19 Resolver repository callbacks, and unified typed listener registration across Maven sessions while preserving existing listener lambdas.
apache/maven · #13011
Public build-platform API feature
Maven extensions can now observe repository operations through stable Maven-owned event types without depending directly on Resolver internals.
Problem
Maven's public Session listener API exposed execution activity but offered no Maven-owned contract for repository resolution, download, installation, deployment, or metadata events. Extensions otherwise had to couple themselves to Resolver API types and lifecycle details.
Approach
Adds typed `RepositoryEvent`, `RepositoryEventType`, `RepositoryListener`, execution-event counterparts, and immutable repository metadata; converts Resolver artifacts, repositories, paths, failures, and request traces; and dispatches through a shared, thread-safe listener registry with failure isolation.
Impact and scope
- Gives Maven extensions a stable public API for observing artifact and metadata operations across resolution, download, installation, and deployment.
- Prevents Resolver implementation types from leaking into Maven's consumer-facing event contract.
- Supports combined typed listeners, derived-session sharing, concurrent registration, and isolated listener failures without breaking existing functional-interface lambdas.
Validation
- Regression suites cover all 17 execution callbacks and 19 repository event types, field conversion, request traces, metadata mapping, combined listeners, derived sessions, concurrent registration, immutable views, null handling, and failure isolation.
- Final GitHub full-build and integration-test jobs passed across macOS, Ubuntu, and Windows on JDK 17, 21, and 25.
- The Maven maintainer review confirmed all earlier API documentation findings were resolved and approved the squashed state; the GitHub-verified merge commit credits Goutam Adwant and closed MNG-8547.