I'm trying to generate Java classes starting from an XML Schema Definition
but I'm getting an error about a Property "Lang" is already defined.
[ERROR] http://www.w3.org/2002/08/xhtml/xhtml1-strict.xsd [302,52]
com.sun.istack.SAXParseException2: Property "Lang" is already defined. Use <jaxb:property> to resolve this conflict.
[ERROR] http://www.w3.org/2002/08/xhtml/xhtml1-strict.xsd [303,35]
com.sun.istack.SAXParseException2
The XSD I'm using defines the Common Weakness Enumeration (CWE) and is located at https://cwe.mitre.org/data/xsd/cwe_schema_v6.10.xsd
A short command to reproduce the error is:
xjc http://www.w3.org/2002/08/xhtml/xhtml1-strict.xsd
This is my pom.xml
<build>
<plugins>
<!-- https://www.mojohaus.org/jaxb2-maven-plugin/#/repo -->
<!-- https://www.mojohaus.org/jaxb2-maven-plugin/Documentation/v3.1.0/index.html -->
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>jaxb2-maven-plugin</artifactId>
<version>3.1.0</version>
<configuration>
<sources>
<source>_schema_/cwe</source>
</sources>
<xjbSources>
<xjbSource>${basedir}/cti-domain/src/main/xjb</xjbSource>
</xjbSources>
<outputDirectory>${basedir}/cti-domain/src/main/java</outputDirectory>
<clearOutputDir>false</clearOutputDir>
</configuration>
<executions>
<execution>
<id>xjc</id>
<goals>
<goal>xjc</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
and this is my attempt to fix the error:
<!-- cti-domain/src/main/xjb/cwe-bindings.xjb -->
<jxb:bindings version="1.0"
xmlns:jxb="https://jakarta.ee/xml/ns/jaxb"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<jxb:bindings schemaLocation="../../../../_schema_/cwe/cwe_schema_v6.10.xsd" node="//xsd:schema">
<jxb:schemaBindings>
<jxb:package name="com.example.cwe"/>
</jxb:schemaBindings>
<!-- <jxb:bindings schemaLocation="http://www.w3.org/2002/08/xhtml/xhtml1-strict.xsd" node="//xsd:schema">-->
<!-- <jxb:property name="Language"/>-->
<!-- </jxb:bindings>-->
</jxb:bindings>
</jxb:bindings>