Replace JDOM2 with DomTrip for lossless POM XML editing#1466
Open
Replace JDOM2 with DomTrip for lossless POM XML editing#1466
Conversation
Member
|
woohoo! 2k lines gone! |
DomTrip provides lossless XML round-tripping, preserving comments, whitespace, attribute order, quote styles, CDATA sections, and entity encoding. This eliminates the intro/outtro hacks required by JDOM2. - Replace `org.jdom:jdom2` with `eu.maveniverse.maven.domtrip:domtrip-core:1.1.0` - Implement 16 DomTrip wrapper classes mirroring the previous JDOM2 wrappers - Delete all JDOM2 source (18 files) and test (8 files) classes - Switch default ModelETL from `jdom2` to `domtrip` - Add 8 new unit test classes (147 tests) covering all DomTrip wrappers - Add formatting preservation IT with byte-for-byte comparison - Fix `DomTripProperties.put()` to return previous value per `Hashtable.put` contract Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
0bc4b06 to
566e048
Compare
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.
Summary
Closes #1381
org.jdom:jdom2dependency witheu.maveniverse.maven.domtrip:domtrip-core:1.1.0DomTripModel,DomTripModelETL,DomTripScm,DomTripProperties, etc.)jdom2todomtripDomTripProperties.put()to return the previous value per theHashtable.putcontractDomTrip provides lossless XML round-tripping, preserving comments, whitespace, attribute order, quote styles, CDATA sections, and entity encoding. This eliminates the intro/outtro hacks that the JDOM2 implementation required (regex-based intro/outtro extraction, whitespace collapsing in attributes, line ending normalization).
Breaking change
The
ModelETLFactorynamed binding changed from"jdom2-sax"to"domtrip". This is an internal extension point not exposed via public configuration — no external consumers are known to reference the old name. If you subclassedAbstractRewritePomsPhaseand hardcoded"jdom2-sax", update to"domtrip".Test plan
🤖 Generated with Claude Code