java 8 - JAXB (RI) libraries vs. JDK -


using maven, there couple of plugins support e.g. generation of jaxb classes xsd, e.g. org.codehaus.mojo:jaxb2-maven-plugin , org.jvnet.jaxb2.maven2:maven-jaxb2-plugin. newest version of have dependencies e.g. org.glassfish.jaxb:jaxb-xjc , org.glassfish.jaxb:jaxb-runtime (in version 2.2.11).

but wonder happen if used generate classes xsd use jdk 8 (which contains version 2.2.8) @ runtime: wouldn't there risk runtime errors?
so necessary or recommended use jaxb-runtime corresponding jaxb-xjc version used generate classes xsd?

of course override dependencies jaxb-xjc etc. , explicitly use version 2.2.8. wonder if same result if used jdk 8 xjc tool directly?

you have 3 phases:

  • (1) generation of schema-derived code
  • (2) compilation of schema-derived code
  • (3) runtime

the important jaxb api use compile (2) compatible jaxb api use in runtime (3). if not case might compile code uses annotation later not available in runtime. , you'll see error first in runtime.

as (1) vs. (2), necessary. if generate jaxb 2.2.x , use jaxb 2.1.x compile, not work. less critical compilation error forced correct.

so if problem jaxb version used vs. jaxb version embedded in jdk, wouldn't worry this. long compiles, you're safe can ever be.


Comments

Popular posts from this blog

python - pip install -U PySide error -

arrays - C++ error: a brace-enclosed initializer is not allowed here before ‘{’ token -

cytoscape.js - How to add nodes to Dagre layout with Cytoscape -