You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "gnodet (via GitHub)" <gi...@apache.org> on 2026/06/22 18:11:05 UTC

[PR] [Backport 4.0.x] Fix NPE in DefaultLookup.lookupOptional() when container returns null [maven]

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: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [Backport 4.0.x] Fix NPE in DefaultLookup.lookupOptional() when container returns null [maven]

Posted by "gnodet (via GitHub)" <gi...@apache.org>.
gnodet merged PR #12340:
URL: https://github.com/apache/maven/pull/12340


-- 
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: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org