Is there a JAXB Plugin which generates Builders?

Asaf Mesika picture Asaf Mesika · Dec 10, 2013 · Viewed 10.5k times · Source

Are you aware of any good JAXB Plugin which generated Builder pattern classes for the generated JAXB classes? Composing domain using JAXB generated classes is really nasty. I saw a plugin someone wrote back in 2010 but it doesn't use the newest maven plugin jaxb2-maven-plugin, and it also requires you to specify bindings for each schema type which is not robust.

Answer

Mirko Klemm picture Mirko Klemm · Mar 23, 2014

Yes, there is now a plugin to generate fluent builders for JAXB-generated classes. There is a github project on

https://github.com/mklemm/jaxb2-rich-contract-plugin

It contains a couple of useful JAXB plugins. You can download source and binaries from github, or get maven artifacts from The Central Repository

Hope this helps. If you have any questions, just ask me, I'm the one who started it.