Skip to content

Backport #12237: Add XmlService classloader fallback for ServiceLoader discovery#12254

Merged
gnodet merged 1 commit into
apache:maven-4.0.xfrom
gnodet:cherry-pick-12237-to-4.0.x
Jun 13, 2026
Merged

Backport #12237: Add XmlService classloader fallback for ServiceLoader discovery#12254
gnodet merged 1 commit into
apache:maven-4.0.xfrom
gnodet:cherry-pick-12237-to-4.0.x

Conversation

@gnodet

@gnodet gnodet commented Jun 13, 2026

Copy link
Copy Markdown
Contributor

Backport of #12237 to 4.0.x branch.

@gnodet gnodet added this to the 4.0.0-rc-6 milestone Jun 13, 2026
…he#12237)

* Add XmlService classloader fallback for ServiceLoader discovery

When the thread context classloader cannot see the XmlService
provider (e.g. in plugin classloaders), fall back to loading
via XmlService's own classloader. This prevents
IllegalStateException("No XmlService implementation found")
in environments where the TCCL is isolated.

Co-authored-by: Arturo Bernal <abernal@apache.org>

* Use import instead of FQCN for Optional

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Arturo Bernal <abernal@apache.org>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
@gnodet gnodet force-pushed the cherry-pick-12237-to-4.0.x branch from fd9d4b7 to b135413 Compare June 13, 2026 08:23
@gnodet gnodet merged commit aa3783f into apache:maven-4.0.x Jun 13, 2026
22 checks passed
@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.

1 participant