arturobernalg opened a new pull request, #13539: URL: https://github.com/apache/maven/pull/13539
Fixes #8635 ### What and why `LifecycleDependencyResolver` sent the `DependencyResolutionResult` to the event spies only after a successful resolution. When the resolution failed, the `DependencyResolutionException` was turned into a `LifecycleExecutionException` before the dispatch, so a listener got the request but no result, and had to look for the result in the cause of an `ExecutionEvent`. The issue asks for the result to be fired when the resolution fails too. ### How The result is dispatched right after the resolution, in the success path and in the `catch` block, and the dispatch after the `try` is removed. The order for a successful resolution does not change, and an aggregator which tolerates the failure still gets the result once. ### Tests `LifecycleDependencyResolverEventsTest` is new, with a mocked resolver and event dispatcher: the result is fired once when the resolution succeeds, when it fails, and when an aggregator tolerates the failure. The failure test fails on master (the result is never dispatched) and the three pass with the change, three runs in a row. `maven-core` passes (746 tests) and spotless is clean. I did not run the integration tests. This changes what the listeners receive on a failed resolution, so a backport is up to the maintainers. --- To make clear that you license your contribution under the [Apache License Version 2.0, January 2004](https://www.apache.org/licenses/LICENSE-2.0) check one of the following: - [ ] I hereby declare this contribution to be licensed under the [Apache License Version 2.0, January 2004](https://www.apache.org/licenses/LICENSE-2.0) - [ ] I hereby declare that I have filed an [Apache Individual Contributor License Agreement](https://www.apache.org/licenses/icla.pdf). -- 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]
