Skip to content

Conversation

@gnodet
Copy link
Contributor

@gnodet gnodet commented Dec 9, 2025

Backport

This will backport the following commits from maven-4.0.x to master:

Questions ?

Please refer to the Backport tool documentation

…apache#11529)

When multiple model parsers are registered (e.g., for YAML or TOML POMs)
and all parsers fail to parse a POM file, the error message now provides
detailed information about each parser's failure.

Changes:
- Changed modelParsers from List to Map<String, ModelParser> to preserve
  parser names for better error messages
- Added buildDetailedErrorMessage() method that generates a comprehensive
  error report including:
  - The POM file path
  - The number of parsers attempted
  - Each parser's error with line/column information when available
  - The default XML reader's error
- Updated all call sites to use Map.of() instead of List.of()

This improves debugging when using alternative POM formats by showing
exactly why each parser failed, rather than just the final XML error.

(cherry picked from commit 71261c2)

# Conflicts:
#	impl/maven-impl/src/test/java/org/apache/maven/impl/DefaultPluginXmlFactoryTest.java
@gnodet gnodet added bug Something isn't working backport labels Dec 9, 2025
@gnodet gnodet merged commit 8e5e7f1 into apache:master Dec 9, 2025
22 checks passed
@github-actions github-actions bot added this to the 4.1.0 milestone Dec 9, 2025
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.

1 participant