Upgrade to Maven 4.0.0-rc-5 and migrate to public API#75
Open
slachiewicz wants to merge 1 commit intomasterfrom
Open
Upgrade to Maven 4.0.0-rc-5 and migrate to public API#75slachiewicz wants to merge 1 commit intomasterfrom
slachiewicz wants to merge 1 commit intomasterfrom
Conversation
- Replace XmlNodeBuilder (internal API) with XmlService (public API) for trim=true cases - Keep XmlNodeBuilder only for trim=false to preserve backwards compatibility - Add XmlPullParserToXMLStreamReaderAdapter to bridge XmlPullParser and XMLStreamReader - Update InputLocationBuilder interface to use XMLStreamReader instead of XmlPullParser - Remove deprecated 'detail' field and getDetail() method from XmlPullParserException - Update tests to match new InputLocationBuilder signature All 217 tests pass successfully.
Member
Author
|
@gnodet wdyt - make sense this PR? |
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
This PR upgrades the project to use Maven 4.0.0-rc-5 and migrates from internal Maven APIs to public APIs where possible, while maintaining backwards compatibility.
Changes
Main Code Changes
Xpp3DomBuilder.java
org.apache.maven.internal.xml.XmlNodeBuilderwith public APIorg.apache.maven.api.xml.XmlServicefor cases withtrim=true(default behavior)XmlNodeBuilder(internal API) only fortrim=falsecases to preserve backwards compatibility (XmlService doesn't support trim parameter)InputLocationBuilderinterface to acceptjavax.xml.stream.XMLStreamReaderinstead ofXmlPullParser(aligns with Maven 4 public API)XmlPullParserToXMLStreamReaderAdapter.java (new)
XmlPullParser→XMLStreamReaderhasName()andhasText()XmlPullParserException.java
detailfield (marked@Deprecated)getDetail()method - use standardgetCause()insteadTest Changes
Xpp3DomTest.java
FixedInputLocationBuilderto acceptXMLStreamReaderinstead ofXmlPullParserXpp3DomBuilderTest.java
InputLocationBuilderimplementation to useXMLStreamReader.getLocation().getLineNumber()instead ofXmlPullParser.getLineNumber()Testing
✅ All 217 tests pass (1 skipped)
⚠️ Minimal use of internal API only for special cases (trim=false) - required for backwards compatibility
✅ Code compiles without errors
✅ Package builds successfully
✅ Uses Maven 4 public API where possible (XmlService for trim=true)
API Usage
org.apache.maven.api.xml.XmlService,org.apache.maven.api.xml.XmlNodeorg.apache.maven.internal.xml.XmlNodeBuilder- only for trim=falseorg.apache.maven.internal.xml.XmlNodeImpl- used throughout project as wrapper