-
Notifications
You must be signed in to change notification settings - Fork 18
ph jaxb
A special JAXB helper project. It supports both the JDK included JAXB as well as an external JAXB that is used via a separate Maven artefact.
Add the following to your pom.xml to use this artifact:
<dependency>
<groupId>com.helger.commons</groupId>
<artifactId>ph-jaxb</artifactId>
<version>x.y.z</version>
</dependency>
Note: the Maven groupId changed in v10 from com.helger
to com.helger.commons
In your application you also need to provide a real JAXB implementation, as this project is only using the JAXB API as a dependency. To include the reference implementation add this depndency:
<dependency>
<groupId>com.sun.xml.bind</groupId>
<artifactId>jaxb-impl</artifactId>
</dependency>
See below what needs to be considered to use alternative JAXB implementations.
-
com.helger.jaxb
- JAXB context cache, abstract reader, writer and validator interfaces. -
com.helger.jaxb.builder
- Abstract builder for JAXB based readers, writers and validators. -
com.helger.jaxb.validation
- validation event handler (factories) for JAXB marshalling/unmarshalling.
My information are primarily based on https://docs.oracle.com/middleware/12213/toplink/develop-document-bindings/runtime.htm#TLJAX137
- You need at least ph-commons 10.1.2
- Add the necessary dependencies to your pom.xml
- Please a
jaxb.properties
file in each JAXB package
Tested with MOXy 2.7.8
Add this to your pom.xml
:
<dependency>
<groupId>org.eclipse.persistence</groupId>
<artifactId>org.eclipse.persistence.moxy</artifactId>
<version>2.7.8</version>
</dependency>
if your XSD uses a base64Binary
data type, you may also need this dependency:
<dependency>
<groupId>com.sun.mail</groupId>
<artifactId>jakarta.mail</artifactId>
<version>1.6.5</version>
</dependency>
and each JAXB package must contain a file jaxb.properties
with this content:
javax.xml.bind.context.factory=org.eclipse.persistence.jaxb.JAXBContextFactory
On Twitter: Follow @philiphelger
Donation link: https://paypal.me/PhilipHelger
It is appreciated if you star the GitHub project if you like it.