Skip to content

Jakarta Compatibility

Choose a tag to compare

@runeflobakk runeflobakk released this 10 Oct 13:47
· 23 commits to main since this release
ce1275c

This release makes the library compatible with the Jakarta EE v9 and later APIs. This means the library is compatible with Spring Boot 3, but compatibility with earlier versions are retained, as the library is not tied to any particular Java/Jakarta EE API level (javax vs. jakarta).

Under the hood, Spring OXM has been removed and replaced with direct use of the underlying jaxb-api for JAXB marshalling, thus eliminating all Spring dependencies. And the use of Jersey Client has been replaced with Apache Http Client v5.2. Under normal circumstances you do not need to pay any attention to this, as this is encapsulated as internal to the library.

Changes: Configuration API

The Configuration.Builder API is slightly changed, though the other parts of the API remain unchanged. Please refer to Create client configuration (choose the "Java" tab) in the documentation if you need help with migrating from v6 to v7. The changes can be summarized as:

  • "serviceUri" and "trustStore" has been combined and replaced with ServiceEnvironment. Instead of separately specifying the former two, instead specify either ServiceEnvironment.STAGING or ServiceEnvironment.PRODUCTION depending on which API you intend to use.
  • the concept "global sender" has been renamed to defaultSender.

@implNote javax.xml.bind

The observant developer will notice that we have actually not upgraded the internal JAXB stack to Jakarta JAXB, but still depend on the older JAXB v2 (javax.xml.bind). This is done to preserve compatibility with users who have not migrated to newer Jakarta libraries/frameworks (e.g. Spring Boot 3), and care has been taken, with help of jaxb-resolver-com.sun.xml.bind, to depend on JAXB v2 artifacts which may exist alongside any Jakarta EE artifacts (also Jakarta JAXB) without interfering. This also enables us to keep the library compatible with Java 8 (although we strongly advise to upgrade your Javas ☕️).

Posten signering uses already uses this library with Spring Boot v3, with no additional tweaking besides depending on the library.