Skip to content

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

Merged
gnodet merged 2 commits into
apache:masterfrom
gnodet:port/13947-extensions-xml-error-master
Nov 12, 2026
Merged

gnodet merged 2 commits into
apache:masterfrom
gnodet:port/13947-extensions-xml-error-master

Conversation

@gnodet

@gnodet gnodet commented Nov 12, 2026

Copy link
Copy Markdown
Contributor

Port of #13947 (maven-3.10.x) to the master 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

Port of apache#13947 (maven-3.10.x) to the `master` 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 added the bug Something isn't working label Nov 12, 2026
@gnodet gnodet added this to the 4.2.0 milestone Nov 12, 2026

@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 fix: wraps the bare XMLStreamException/EOFException from the StAX parser in an IOException naming the file, root cause preserved. Consistent with the merged companion #13947 on maven-3.10.x. Visibility change (private → package-private) is justified by direct test access from the same package.

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

@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 `master` 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-master branch from 65748a0 to 77da233 Compare November 12, 2026 15:53
@gnodet
gnodet merged commit 2b171a8 into apache:master Nov 12, 2026
22 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.

[MNG-8369] Empty .mvn/extensions.xml should not just print EOFException

3 participants