Skip to content

fix(maven): Preserve XML attributes when updating pom.xml files#279

Merged
TimothyJones merged 3 commits intomasterfrom
claude/fix-issue-268-J5d5m
Mar 18, 2026
Merged

fix(maven): Preserve XML attributes when updating pom.xml files#279
TimothyJones merged 3 commits intomasterfrom
claude/fix-issue-268-J5d5m

Conversation

@TimothyJones
Copy link
Copy Markdown
Member

As reported in #268, XML attributes were silently stripped.

This is because the XMLParser and XMLBuilder from fast-xml-parser were instantiated
without attribute-related options, and for some reason it defaults to ignoring them. I'm going to assume there's a good reason for that, because... maybe there is one? Who can say.

Anyway, this PR fixes the issue by configuring the parser not to ignore attributes, and configuring the builder to emit them.

Thanks Claude for making diagnosing this issue super easy.

claude added 3 commits March 18, 2026 10:30
The XMLParser and XMLBuilder from fast-xml-parser were instantiated
without attribute-related options, causing all XML attributes to be
silently stripped during version bumping. This corrupted pom.xml files
that contained elements with attributes (e.g., plugin configurations).

Configure the parser with ignoreAttributes: false, parseTagValue: false,
and parseAttributeValue: false, and the builder with matching options
to preserve attributes, prevent boolean shorthand, and handle
self-closing tags correctly.

Fixes #268

https://claude.ai/code/session_01MnZuTu64zEfCCP1edZDdo8
@TimothyJones TimothyJones merged commit 81b4f98 into master Mar 18, 2026
6 checks passed
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.

2 participants