Repository navigation
Conversation
readCoreExtensionsDescriptor() let any failure from the XML parser escape as-is, so an empty or otherwise malformed .mvn/extensions.xml surfaced as a bare "input contained no data" EOFException 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-bot
approved these changes
Nov 11, 2026
gnodet-bot
left a comment
Contributor
There was a problem hiding this comment.
Clean, minimal fix that wraps opaque XML-parser exceptions in an IOException naming the offending file. The exception chain is correct (e.getMessage() + cause), the test covers the reported case, and widening the method visibility follows the existing pattern in this class.
One low-severity nit on the method signature (see inline).
The PR body mentions the equivalent code path in maven-3.9.x — a backport to maven-3.9.17 would be welcome if a maintainer agrees.
This review was generated by an AI agent, Hermès on behalf of @gnodet.
gnodet
approved these changes
Nov 12, 2026
gnodet
approved these changes
Nov 12, 2026
The catch block wraps every IOException and XmlPullParserException into a new IOException, so XmlPullParserException can never escape readCoreExtensionsDescriptor() - declaring it on the method signature is misleading to callers.
gnodet
approved these changes
Nov 12, 2026
This was referenced Nov 12, 2026
gnodet
added a commit
to gnodet/maven
that referenced
this pull request
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
added a commit
to gnodet/maven
that referenced
this pull request
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
added a commit
that referenced
this pull request
Nov 12, 2026
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
added a commit
that referenced
this pull request
Nov 12, 2026
* [MNG-8369] Report a clear error for an unparsable extensions.xml 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 * Report a clear error for an unparsable extensions.xml 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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
readCoreExtensionsDescriptor() let any failure from the XML parser escape as-is, so an empty or otherwise malformed .mvn/extensions.xml surfaced as a bare "input contained no data" EOFException 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
Also reproduces on maven-3.9.9/3.9.x via the equivalent code in maven-embedder's MavenCli (same unguarded parser.read() call, different file API). Happy to open a backport PR to maven-3.9.x if a maintainer wants it there too.