Skip to content

Restore buildConfiguration() callback in deprecated PluginDescriptorBuilder.build() methods#11869

Merged
gnodet merged 1 commit into
masterfrom
navy-spoon
May 19, 2026
Merged

Restore buildConfiguration() callback in deprecated PluginDescriptorBuilder.build() methods#11869
gnodet merged 1 commit into
masterfrom
navy-spoon

Conversation

@gnodet
Copy link
Copy Markdown
Contributor

@gnodet gnodet commented Mar 31, 2026

Summary

  • Restore buildConfiguration() callback in the deprecated build(Reader, String) and build(InputStream, String) methods
  • The [MNG-7947] refactoring inadvertently bypassed this overridable method, breaking subclasses like EnhancedPluginDescriptorBuilder in maven-plugin-tools
  • The legacy code path now detects the namespace (PLUGIN 2.0.0 vs legacy), and calls buildConfiguration() for the legacy format

Context

This fixes the root cause of apache/maven-plugin-tools#806 and unblocks apache/maven-plugin-tools#1091 (Maven 4 CI).

The build(Reader, String) method was changed from:

return build(source, buildConfiguration(reader));

to:

return build(() -> reader, source);

which skips the buildConfiguration() callback entirely. Subclasses that override buildConfiguration() to intercept the parsed configuration (e.g., to extract requiredJavaVersion) get a null field and NPE.

Test plan

  • mvn compile test passes in compat/maven-plugin-api
  • Full CI
  • Verify maven-plugin-tools reporting ITs pass with this Maven build

🤖 Generated with Claude Code

The MNG-7947 refactoring changed the deprecated build(Reader, String) and
build(InputStream, String) methods to delegate to the new
build(ReaderSupplier/StreamSupplier, String) methods, which bypassed the
overridable buildConfiguration() method. This broke subclasses (such as
EnhancedPluginDescriptorBuilder in maven-plugin-tools) that override
buildConfiguration() to intercept the parsed configuration.

Restore the buildConfiguration() callback in the legacy code path while
still supporting PLUGIN 2.0.0 namespace detection.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@gnodet gnodet marked this pull request as ready for review May 19, 2026 13:32
@gnodet gnodet merged commit 498e0fd into master May 19, 2026
43 of 44 checks passed
@gnodet gnodet deleted the navy-spoon branch May 19, 2026 13:32
@github-actions github-actions Bot added this to the 4.1.0 milestone May 19, 2026
@github-actions
Copy link
Copy Markdown

@gnodet Please assign appropriate label to PR according to the type of change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants