Skip to content

Depend on maven-api-xml at compile and maven-xml at runtime - #96

Merged
slachiewicz merged 1 commit into
masterfrom
split-maven-xml-scopes
Aug 18, 2026
Merged

Depend on maven-api-xml at compile and maven-xml at runtime#96
slachiewicz merged 1 commit into
masterfrom
split-maven-xml-scopes

Conversation

@slachiewicz

Copy link
Copy Markdown
Member

After #94 the main sources import three Maven types — XmlNode twice and XmlService once — and all of them
live in maven-api-xml. maven-xml is needed only at runtime, where XmlService loads its implementation through
ServiceLoader and Xpp3Dom.mergeXpp3Dom reaches it.

+- org.apache.maven:maven-api-xml:jar:4.0.0-rc-6:compile
|  \- org.apache.maven:maven-api-annotations:jar:4.0.0-rc-6:compile
+- org.apache.maven:maven-xml:jar:4.0.0-rc-6:runtime
|  +- com.fasterxml.woodstox:woodstox-core:jar:7.2.1:runtime
|  \- org.codehaus.woodstox:stax2-api:jar:4.3.0:runtime

Consumers keep maven-api-xml transitively at compile, which is what Xpp3Dom.getDom() and the XmlNode
constructors need. What they lose from their compile classpath is org.apache.maven.internal.* together with
maven-xml's own compile transitives, woodstox-core and stax2-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-xml either way.

The org.eclipse.sisu.plexus exclusion goes with the old stanza. maven-xml declares that dependency at provided
scope, 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.

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.
@slachiewicz slachiewicz added the dependencies Pull requests that update a dependency file label Aug 17, 2026
@slachiewicz
slachiewicz marked this pull request as ready for review August 17, 2026 15:03
@slachiewicz
slachiewicz requested review from gnodet and a lite review from Copilot August 17, 2026 15:52

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 mavenXmlVersion property to centralize the Maven XML artifact version.
  • Adds org.apache.maven:maven-api-xml as a compile dependency.
  • Changes org.apache.maven:maven-xml to runtime scope and removes the now-unnecessary org.eclipse.sisu.plexus exclusion.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@slachiewicz
slachiewicz merged commit 38c200b into master Aug 18, 2026
24 of 28 checks passed
@slachiewicz
slachiewicz deleted the split-maven-xml-scopes branch August 18, 2026 10:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants