Using the JXC schema generation ant task, I can't seem to get it to ignore an enum. I have several enums that are used internally to denote type or minor configuration values that are not relevant to the generated XML.
I can exclude the field using the enum as @XmlTransient to exclude it from the object's schema, but a simpleType descriptor is still generated for the enum!
Example:
public class CustomerType {
@XmlTransient
public enum IsolationLevel { ALL, SAME_TYPE, SELECTED }
@XmlTransient
private Long id;
@XmlValue
private String name;
@XmlTransient
private IsolationLevel isolation = IsolationLevel.ALL;
}
Generated Schema:
<xs:simpleType name="isolationLevel">
<xs:restriction base="xs:string">
<xs:enumeration value="ALL"/>
<xs:enumeration value="SAME_TYPE"/>
<xs:enumeration value="SELECTED"/>
</xs:restriction>
</xs:simpleType>
Anyone have any ideas on how to make JXC ignore the enum? It's not being used by any XML mapped property or field, and the enum itself is marked @XmlTransient - why is it still part of my schema?
I just ran into this as well and updated my pom to 2.2.11 and it's at least fixed for that version. The Jira bug mentioned in the comments also states it's been fixed in 2.2.5. In doing this I had to add the three dependencies as shown below: