If got a Java library which other projects depend on (.jar dependancy through Maven). In this library there is an XSD-file which defines some xs:simpleType
s which are also annotated with xjc:javaType
elements mapping the simple types to already existing java classes and adapter classes in that library. This all works fine, but now I wanted to create a xs:complexType
. I let the org.jvnet.jaxb2.maven2:maven-jaxb2-plugin
version 0.8.2 create some java beans from the complex type and an addition .episode file.
In my second project I import the library, unpack the xsd file into a schema directory and let project2.xsd import the library.xsd, because it uses the simple and complex types. To avoid double generation of already existing beans, I added the libary as an depenancy in the episodes
tag of the org.jvnet.jaxb2.maven2:maven-jaxb2-plugin
. But now the plugin complains that it can't parse the xsd file and throws an exception on every type defintion line.
I presume there is some issue with using episodes (they don't include simpleTypes?) and xjc:javaType
annotations? Is there some kind of workaround to this problem? I can't find much on the web regarding this issue. Grateful for any hint.
I've achieved the same thing by using maven-hyperjaxb3-plugin Check how is done:
here are the project dependencies:
I have any kind of simple and complex types defined and it works like a charm. Hope it helps!