Fix NPE in EnhancedPluginDescriptorBuilder with Maven 4#1094
Closed
gnodet wants to merge 1 commit intoapache:maven-plugin-tools-3.xfrom
Closed
Fix NPE in EnhancedPluginDescriptorBuilder with Maven 4#1094gnodet wants to merge 1 commit intoapache:maven-plugin-tools-3.xfrom
gnodet wants to merge 1 commit intoapache:maven-plugin-tools-3.xfrom
Conversation
Maven 4 refactored PluginDescriptorBuilder.build(Reader, String) to no longer call buildConfiguration(), which EnhancedPluginDescriptorBuilder overrides to capture the raw PlexusConfiguration. This caused a NPE when accessing configuration.getChild() since the field was never set. When running under Maven 4, the PluginDescriptorBuilder already populates requiredJavaVersion and requiredMavenVersion directly on the PluginDescriptor, so we can read them from there instead of from the raw configuration. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Contributor
Author
|
Closing in favor of the proper fix in Maven itself: apache/maven#11869 The root cause is that Claude Code on behalf of Guillaume Nodet |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
EnhancedPluginDescriptorBuilder.build(Reader, String)when running under Maven 4PluginDescriptorBuilder.build()to no longer callbuildConfiguration(), leaving theconfigurationfield nullconfigurationis null (Maven 4+), readrequiredJavaVersion/requiredMavenVersionfrom thePluginDescriptordirectly, since Maven 4's builder already populates themFixes #806
Context
This is the main blocker for #1091 (enable Maven 4 CI builds). Maven 4 changed
PluginDescriptorBuilder.build(Reader, String)in MNG-8084 to delegate to a newbuild(ReaderSupplier, String)method that no longer calls the overridablebuildConfiguration(). TheEnhancedPluginDescriptorBuilderrelied on that callback to capture the raw XML configuration.Test plan
🤖 Generated with Claude Code