Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to run XJC with Java 11 and maven?

To generate java classes from XSD (for reading XML files), we used jaxb2-maven-plugin and Java8.

For java 11, we get many issues...

What libraries and plugins do work (today), allowing to generate java code from XSD using java 11 and maven? If possible point out different solutions, such as with cxf-xjc-plugin, jaxb2-Maven-Plugin and others.

like image 263
Walter Kuhn Avatar asked Jan 22 '19 09:01

Walter Kuhn


1 Answers

I've just investigated the same topic. The best way for Java 11 is to use cxf-xjc-plugin. It's a Maven plugin. No other Maven plugin is able to work under Java 11 without annoying workarounds.

I've published a complete example with cxf-xjc-plugin here: https://artofcode.wordpress.com/2019/02/28/generating-classes-from-xsd-under-java-11-the-right-way/

like image 79
Krzysztof Tomaszewski Avatar answered Oct 07 '22 01:10

Krzysztof Tomaszewski