The code I\'m working on is using jaxb2-maven-plugin
from org.codehaus.mojo
to generate Java classes from XSD schema. I\'m looking for a way to aut
My answer is for those who can't afford any third part dependency on their generated code.
The org.jvnet.jaxb2_commons:jaxb2-basics plugin adds a lots of org.jvnet
includes in the generated code and your project will depend on org.jvnet.jaxb2_commons:jaxb2-basics-runtime
.
The org.andromda.thirdparty.jaxb2_commons:commons-lang-plugin plugin generates code which depends on commons-lang:commons-lang
. This dependency might be easier to bear depending on the situation.
I finally found this source code, it might be included in com.sun.xml.bind:jaxb-xjc at some point (version 2.2.4 ?), but until then I can't see any other solution than writing your own plugin.
PS: I can't access confluence.highsource.org, I get a 404. I guess it might have been helpful.
PPS: In my situation, the application I am building is targeted to an environment which has a very limited set of allowed Java libraries (incongruous security restrictions). I was a bit disappointed by the fact that jaxb2_commons
includes a bunch of org.jvnet
dependencies in the generated source, just for adding a boring equals
method. I can understand the strategy of jvnet, their tools are very powerful, I may just be trying and using a sledgehammer to crack a nut. Still, I was sorry to note that it was so difficult to find a suitable tool for my situation.