gnodet opened a new pull request, #11825: URL: https://github.com/apache/maven/pull/11825
## Summary - `DefaultExtensionRealmCache`, `DefaultPluginRealmCache`, and `DefaultProjectRealmCache` implement Plexus `Disposable` - Their `dispose()` method called `flush()`, which disposed ClassRealms via `realm.getWorld().disposeRealm()` - Plexus `Disposable.dispose()` runs **before** Sisu's `@PreDestroy` callbacks, so beans loaded from extension/plugin ClassRealms would get `ClassNotFoundException` when their `@PreDestroy` methods executed - Fix: `dispose()` now only clears the cache map without disposing realms. The `flush()` method (for explicit cache clearing between builds) remains unchanged. Fixes #10571 ## Test plan - [ ] Verify plugins with `@PreDestroy` lifecycle methods no longer throw `ClassNotFoundException` at shutdown - [ ] Verify `flush()` still works correctly for cache clearing between builds (e.g., resident Maven) 🤖 Generated with [Claude Code](https://claude.com/claude-code) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
