Skip to content

Update jakarta.xml.bind-api to 3.0+ #313

Closed

Description

@pigelvy

Hi,

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.

Regards

Activity

  1. bodewig commented on Oct 17, 2025

    @bodewig
    Member

    org.xmlunit:xmlunit-jakarta-jaxb-impl depends 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-jakartaxmlbind

  2. pigelvy commented on Oct 17, 2025

    @pigelvy
    Author

    Thanks for the info.

    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.

  3. bodewig commented on Oct 17, 2025

    @bodewig
    Member

    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.

  4. pigelvy commented on Oct 20, 2025

    @pigelvy
    Author

    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...

  5. added this to the 2.11.0 milestone on Oct 20, 2025
  6. bodewig commented on Oct 20, 2025

    @bodewig
    Member

    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.

  7. bodewig commented on Oct 20, 2025

    @bodewig
    Member

    I'm in the process of publishing 2.11.0-SNAPSHOT builds.

  8. pigelvy commented on Oct 21, 2025

    @pigelvy
    Author

    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.

  9. bodewig commented on Oct 24, 2025

    @bodewig
    Member

    I've just publish the release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions