gnodet opened a new pull request, #12340: URL: https://github.com/apache/maven/pull/12340
Backport of #12336 to `maven-4.0.x`. Cherry-pick of 712b5c0791 — clean, no conflicts. ## Summary - `PlexusContainer.lookup()` can return `null` instead of throwing `ComponentLookupException`. `DefaultLookup.lookupOptional()` wraps the result with `Optional.of()`, which throws `NullPointerException` on null input. Changed to `Optional.ofNullable()` so a null result is correctly represented as `Optional.empty()`. - This fixes `maven-jdeprscan-plugin` integration tests (`list-default`, `list-forremoval`) which fail on Maven 4.0.x because `DefaultToolchainManager.retrieveContext()` calls `lookupOptional(Project.class)` and the container returns null. -- 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]
