Depend on maven-api-xml at compile and maven-xml at runtime - #96
Merged
Conversation
Main sources import three Maven types and all live in maven-api-xml: XmlNode and XmlService. maven-xml is needed only at runtime, where XmlService loads its implementation through ServiceLoader and Xpp3Dom.mergeXpp3Dom reaches it. Consumers keep maven-api-xml transitively at compile, which is what Xpp3Dom.getDom() and the XmlNode constructors need. What they lose is org.apache.maven.internal.* and maven-xml's own compile transitives, woodstox-core and stax2-api. The sisu-plexus exclusion goes with it: maven-xml declares that dependency at provided scope, which never propagates.
There was a problem hiding this comment.
Pull request overview
This PR adjusts dependency scopes so plexus-xml compiles against Maven’s public XML API (maven-api-xml) while keeping maven-xml only as a runtime dependency for XmlService’s ServiceLoader-provided implementation.
Changes:
- Introduces a
mavenXmlVersionproperty to centralize the Maven XML artifact version. - Adds
org.apache.maven:maven-api-xmlas a compile dependency. - Changes
org.apache.maven:maven-xmltoruntimescope and removes the now-unnecessaryorg.eclipse.sisu.plexusexclusion.
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
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.
After #94 the main sources import three Maven types —
XmlNodetwice andXmlServiceonce — and all of themlive in
maven-api-xml. maven-xml is needed only at runtime, whereXmlServiceloads its implementation throughServiceLoaderandXpp3Dom.mergeXpp3Domreaches it.Consumers keep
maven-api-xmltransitively at compile, which is whatXpp3Dom.getDom()and theXmlNodeconstructors need. What they lose from their compile classpath is
org.apache.maven.internal.*together withmaven-xml's own compile transitives,
woodstox-coreandstax2-api— worth a line in the 4.2.0 release notes,since anything that was compiling against those was reaching past the API.
Inside Maven 4 nothing moves: plugin and extension resolution includes runtime-scoped transitives, and the api
classes come from core's exported
maven-api-xmleither way.The
org.eclipse.sisu.plexusexclusion goes with the old stanza. maven-xml declares that dependency atprovidedscope, which never propagates; the dependency tree above is unchanged by its removal.
Verified:
mvn verify→ 217 tests, 0 failures.This change was created with AI assistance.