You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
XMLUnit is currently using the jakarta.xml.bind:jakarta.xml.bind-api r2.3.3, which uses the legacy package javax.xml.bind.
Since Jakarta XML Binding 3.0, the package was changed to jakarta.xml.bind.
I think it's time to get away from the old javax.* world and embrace the new jakarta.* one. Several other projects have already migrated and because Maven groupId/artifactId have not changed, we can't use both at the same time.
IMO, it would be a step forward to update this API.
It would also be a step forward to update Java to 11+. It's about time to move on and let Java 8 go.
One remark though... Is it normal for org.xmlunit:xmlunit-jakarta-jaxb-impl to depend on the JAXB implementation org.glassfish.jaxb:jaxb-runtime in scope compile?
It forces the users to use it, or to explicitly exclude it.
Hmm, at least for XMLUnit itself it would be enough to use the compile test scope.
The alternative is that everybody is forced to explicitly specify an implementation, isn't it? If we changed it, the next release would break things for the existing users of xmlunit-jakarta-jaxb-impl who rely on the transitive dependency.
Indeed, changing the scope of the dependency would introduce a breaking change. However, it is a small breaking change that is easy to justify, document and fix.
Furthermore, working with an API and being agnostic of the runtime implementation is the whole point of an API.
All the Jakarta specifications seem to work that way. People must already know about that...
Very nice improvement IMO. Makes XMLUnit cleaner. And for those who'll be impacted, it'll force them to read a little about the JAXB spec and clarify their own dependency management.
I've been looking at your unit tests in xmlunit-jakarta-jaxb-impl and, even though we can always do better, the few tests present use the API and leverage an implementation to assert that the JAXB system works.
It is not the role of XMLUnit to test JAXB thoroughly.
Nice work! I'm looking forward to the releasing of v2.11.0.
Activity
bodewig commentedon Oct 17, 2025
org.xmlunit:xmlunit-jakarta-jaxb-impldepends on 3.0.1 and is what you need to add as a dependency. See https://github.com/xmlunit/user-guide/wiki/JAXB#i-want-to-use-jakartaxmlbindpigelvy commentedon Oct 17, 2025
Thanks for the info.
One remark though... Is it normal for
org.xmlunit:xmlunit-jakarta-jaxb-implto depend on the JAXB implementationorg.glassfish.jaxb:jaxb-runtimein scope compile?It forces the users to use it, or to explicitly exclude it.
bodewig commentedon Oct 17, 2025
Hmm, at least for XMLUnit itself it would be enough to use the
compiletest scope.The alternative is that everybody is forced to explicitly specify an implementation, isn't it? If we changed it, the next release would break things for the existing users of xmlunit-jakarta-jaxb-impl who rely on the transitive dependency.
pigelvy commentedon Oct 20, 2025
Indeed, changing the scope of the dependency would introduce a breaking change. However, it is a small breaking change that is easy to justify, document and fix.
Furthermore, working with an API and being agnostic of the runtime implementation is the whole point of an API.
All the Jakarta specifications seem to work that way. People must already know about that...
remove gard dependency on glassfish's JAXB implementation
remove hard dependency on glassfish's JAXB implementation
bodewig commentedon Oct 20, 2025
Basically I've been verifying my understanding, thanks.
Note that I personally don't use JAXB (neither version) so really only perform the basic testing provided by the unit tests.
bodewig commentedon Oct 20, 2025
I'm in the process of publishing 2.11.0-SNAPSHOT builds.
pigelvy commentedon Oct 21, 2025
Very nice improvement IMO. Makes XMLUnit cleaner. And for those who'll be impacted, it'll force them to read a little about the JAXB spec and clarify their own dependency management.
I've been looking at your unit tests in
xmlunit-jakarta-jaxb-impland, even though we can always do better, the few tests present use the API and leverage an implementation to assert that the JAXB system works.It is not the role of XMLUnit to test JAXB thoroughly.
Nice work! I'm looking forward to the releasing of v2.11.0.
bodewig commentedon Oct 24, 2025
I've just publish the release.