See this issue in XJC. In short, XJC for some reason does not allow custom/vendor customization elements in SCD bindings.inheritance:implements is such customization element.
So no, this does not work due a problem in XJC.
I personally bind via schemaLocation and XPath but use a "virtual" schema location URI and rewrite it via catalogs.
SCD would have been a much better choice (you're absolutely right here) but it just does not work.
Here's an example of binding which customizes some complex type:
It is bound via schemaLocation and XPath. The schemaLocation is an existing URL, but in the build it is rewritten via catalog into the resource inside a Maven artifact:
REWRITE_SYSTEM "http://schemas.opengis.net" "maven:org.jvnet.ogc:ogc-schemas:jar::!/ogc"
So, in combination, it allows writing binding files once and reuse them across modules.
But this was all a huge pain to figure out. I did it for the ogc-schemas project which is now some 50 heavily interconnected schemas. I heavily suffer from XJC drawbacks and issues, but this is the best possible at the moment. I even thought about forking and patching XJC, but this is far of effort limits I can afford.
So I've ended up with a number of mindblogging workarounds which somehow do the job at the end of the day.
Thanks lexicore. What about combining scd and xjc:superInterface... Should that work? Any idea why this approach generates no error, but also does not seem to have any effect on the generated source?
... or is xjc:superInterface considered a custom/vendor customization just like inheritence:implements?
It is actually a vendor extension but its a "first class" vendor extension which is specifically known to XJC (see here) - unlike inheritance:implements. By the way, isn't xjc:superInterface for global bindings only? Would explain why it is ignored on the class.
I think the only thing which would work at the moment is binding to some "global" schemaLocation + XPath + catalogs.
All efforts to use this approach so far fail with this error: [ERROR] "file:/C:/dev/workspace/myapp/etc/form-schemas/common.xsd" is not a part of this compilation. Is this a mistake for "file:/C:/dev/workspace/myapp/etc/form-schemas/v0001/common.xsd"?