Skip to content

Fix #11973: Restore backward-compatible DefaultToolchain constructor#12238

Open
gnodet wants to merge 1 commit into
apache:masterfrom
gnodet:fix-gh-11973
Open

Fix #11973: Restore backward-compatible DefaultToolchain constructor#12238
gnodet wants to merge 1 commit into
apache:masterfrom
gnodet:fix-gh-11973

Conversation

@gnodet
Copy link
Copy Markdown
Contributor

@gnodet gnodet commented Jun 4, 2026

Summary

Fixes #11973

Custom toolchain implementations compiled against Maven 3.x call DefaultToolchain(ToolchainModel, String, org.codehaus.plexus.logging.Logger), which was removed when Maven 4 switched to SLF4J. This causes NoSuchMethodError at runtime.

This PR adds two deprecated backward-compatible constructors that accept the old Plexus Logger parameter and delegate to the existing SLF4J-based constructors.

See also: apache/maven-toolchains-plugin#152

Test plan

  • mvn install -DskipTests builds successfully
  • Run maven-toolchains-plugin ITs with custom toolchain (use-custom-toolchain)

🤖 Generated with Claude Code

…uctor

Add deprecated constructors accepting org.codehaus.plexus.logging.Logger
to maintain binary compatibility with custom toolchain implementations
compiled against Maven 3.x.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@gnodet gnodet added this to the 4.0.0-rc-6 milestone Jun 4, 2026
Copy link
Copy Markdown
Member

@hboutemy hboutemy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tested with maven-toolchain-plugin: it fixes the issue
very good, small fix
thanks

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.

NoSuchMethodError: 'void org.apache.maven.toolchain.DefaultToolchain.<init>

3 participants