Upgrade to Maven 4.0.0-rc-5 and migrate to public API #75
+406
−27
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