I am having some issues with generating Java Classes with appropriate JAXB annotations from an XSD using XJC.
I have a relatively simple XSD file defining my XML sch
This question references a blog post by Kohsuke Kawaguchi, formerly worked on the JAX-B or JAX-WS RI, that talks about the RI's decision making process and lack of clarity on this issue in the spec.
The blog post mentions that the simple binding feature is part of the RI. Are you using the RI to generate your code?
Just bind using xjb-file:
<?xml version="1.0"?>
<jxb:bindings version="1.0" xmlns:jxb="http://java.sun.com/xml/ns/jaxb" xmlns:xjc="http://java.sun.com/xml/ns/jaxb/xjc" jxb:extensionBindingPrefixes="xjc" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<jxb:bindings schemaLocation="path/to/myschema.xsd" node="/xs:schema">
<jxb:globalBindings>
<xjc:simple />
</jxb:globalBindings>
</jxb:bindings>
</jxb:bindings>
And don't forget to define element of the same type:
<xs:complexType name="Artifact" />
<xs:element name="artifact" type="Artifact">