Support schema bindings on Java 9
See original GitHub issueWhen running on Java 9, schema bindings are apparently not applied - instead the XSD’s namespace is used to determine the package.
Description
It makes no difference whether this block is present in the XSD…
<xsd:annotation>
<xsd:appinfo>
<jaxb:schemaBindings>
<jaxb:package name="com.pany.pack.age" />
</jaxb:schemaBindings>
</xsd:appinfo>
</xsd:annotation>
… or this block in a bindings.xjb
…
<jaxb:bindings schemaLocation="that/other/schema.xsd" node="/xsd:schema">
<jaxb:schemaBindings>
<jaxb:package name="com.pany.pack.age" />
</jaxb:schemaBindings>
</jaxb:bindings>
… in both cases, the binding is ignored.
Experiments
I observed that the xjc
command line tool in Java 8 and 9 exhibits the expected behavior and that the difference between the Maven run on Java 8 and 9 was that the former uses rt.jar
as JAXB API, while the latter uses the plugin’s dependency javax.xml.bind:jaxb-api
.
It took me a while but eventually I got the Java 9 Maven build to say Java JAXB API is loaded from the [jrt:/java.xml.bind], i.e. it used the Java 9 module java.xml.bind but that still didn’t do the job.
Sources
Maybe one of these can help (I’m shooting in the dark here, could be utterly irrelevant):
- JEP 255 (merges Selected Xerces 2.11.0 Updates into JAXP)
- JEP 268 (develops a standard XML Catalog API that supports the OASIS XML Catalogs standard, v1.1)
- Apache Camel had another issue and “resolved” it by using
org.apache.cxf:cxf-xjc-plugin
instead - maybe they’re doing something differently?
Related to #114.
Issue Analytics
- State:
- Created 6 years ago
- Reactions:2
- Comments:83 (46 by maintainers)
Top GitHub Comments
In principle, yes, I consider adding Java 9 support.
That problem has something to do with episode files. I have no clue what those are and what they’re used to, but the solution is to put
<epsiode>false</episode>
into the plugin configuration. (Sorry for not being more precise, I don’t have it in front of me right now.)