I have the following snippet in my XSD file. I would expect that it generates a Java enum with the two elements STANDALONE and CONNECTED.
<xs:attribute name="Sample">
<xs:annotation>
<xs:documentation>A sample</xs:documentation>
</xs:annotation>
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="Standalone"/>
<xs:enumeration value="Connected"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
I'm using jaxb2-maven-plugin version 3.1.0
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>jaxb2-maven-plugin</artifactId>
<executions>
<execution>
<id>gen-infrastructure</id>
<goals>
<goal>xjc</goal> <!-- Generates Java sources from XML Schema(s). -->
</goals>
<configuration>
<locale>en,US</locale>
<xjbSources>
<xjbSource>src/main/resources/schema/xsd/sample.xjb</xjbSource>
</xjbSources>
<sources>
<source>src/main/resources/schema/xsd/sample.xsd</source>
</sources>
<!-- The package of your generated sources -->
<packageName>com.company.sample.model.pojos</packageName>
</configuration>
</execution>
</executions>
<configuration>
<noGeneratedHeaderComments>true</noGeneratedHeaderComments>
<clearOutputDir>false</clearOutputDir>
</configuration>
</plugin>
I looked for the same problem on GitHub. I asked another employee in my company if they had a solution or saw what is wrong.