I'm using maven-jaxb2-plugin to generate Java classes from schema files, and want to put the schema files into different modules, using its episode feature.
The same set of schema files can be compiled altogether in one shot without issue. But when split them into two modules, the issue surfaces. The <import/> relationship among my schema files is comparatively complex.
The issue turns out to be rooted in the jaxb-xjc (Sun RI), the version I've tested is 2.2.4u1.
Please use the attached maven project to reproduce the issue. It's stemmed from a real project.
I've patched the class NGCCRuntimeEx in jaxb-xjc version 2.2.4u1. That patch is just the starting point of fixing the issue, and it works for me. It may not be the right/ultimate solution though. The basic idea is to enhance the ParserContext to remember what schemas have been imported.