Skip to content

Report a clear error for an unparsable extensions.xml - #13956

Merged
gnodet merged 1 commit into
apache:maven-4.0.xfrom
gnodet:port/13947-extensions-xml-error-4.0.x
Nov 12, 2026
Merged

gnodet merged 1 commit into
apache:maven-4.0.xfrom
gnodet:port/13947-extensions-xml-error-4.0.x

Conversation

@gnodet

@gnodet gnodet commented Nov 12, 2026

Copy link
Copy Markdown
Contributor

Port of #13947 (maven-3.10.x) to the maven-4.0.x compat layer.

readCoreExtensionsDescriptor() let any failure from the XML parser escape as-is, so an empty or otherwise malformed .mvn/extensions.xml surfaced as a bare EOFException or XMLStreamException with a full stack trace instead of a message naming the problem file.

Wrap the parse failure in an IOException that names the extensions file, keeping the original exception as the cause so -e still shows the full chain.

Fixes #10258

@gnodet gnodet added the bug Something isn't working label Nov 12, 2026
@gnodet gnodet added this to the 4.0.0 milestone Nov 12, 2026
@gnodet gnodet changed the title [MNG-8369] Report a clear error for an unparsable extensions.xml Report a clear error for an unparsable extensions.xml Nov 12, 2026
Port of apache#13947 (maven-3.10.x) to the `maven-4.0.x` compat layer.

readCoreExtensionsDescriptor() let any failure from the XML parser escape
as-is, so an empty or otherwise malformed .mvn/extensions.xml surfaced as
a bare EOFException or XMLStreamException with a full stack trace instead
of a message naming the problem file.

Wrap the parse failure in an IOException that names the extensions file,
keeping the original exception as the cause so -e still shows the full chain.

Fixes apache#10258
@gnodet
gnodet force-pushed the port/13947-extensions-xml-error-4.0.x branch from a3645a0 to 56938a6 Compare November 12, 2026 15:53

@gnodet-bot gnodet-bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM. Clean, minimal backport of #13947 to the 4.0.x compat layer. Exception wrapping preserves root cause, error message is actionable (includes file path), visibility change to package-private is justified for testability, and the test correctly validates the fix.

This review was generated by an AI agent, Hermès on behalf of @gnodet.

@gnodet
gnodet merged commit 6e63ace into apache:maven-4.0.x Nov 12, 2026
24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants