Java jaxb2:xjc两个声明会导致ObjectFactory类中发生冲突。在XSD中使用类型扩展时
我使用了很多复杂类型的模式,扩展如下:Java jaxb2:xjc两个声明会导致ObjectFactory类中发生冲突。在XSD中使用类型扩展时,java,jaxb,xjc,Java,Jaxb,Xjc,我使用了很多复杂类型的模式,扩展如下: <xs:complexType name="GenericFieldValue"> <xs:choice> <xs:element name="String" nillable="true"> <xs:complexType> <xs:simpleContent&
<xs:complexType name="GenericFieldValue">
<xs:choice>
<xs:element name="String" nillable="true">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:string"/>
</xs:simpleContent>
</xs:complexType>
</xs:element>
</xs:choice>
</xs:complexType>
<xs:element name="Value">
<xs:complexType>
<xs:complexContent>
<xs:extension base="aip:GenericFieldValue">
<xs:attribute name="Type" type="aip:GenericDataFieldType" use="required"/>
</xs:extension>
</xs:complexContent>
</xs:complexType>
</xs:element>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>jaxb2-maven-plugin</artifactId>
<version>2.4</version>
<executions>
<execution>
<id>xjc</id>
<goals>
<goal>xjc</goal>
</goals>
</execution>
</executions>
<configuration>
<outputDirectory>${project.basedir}/src/main/java/schema</outputDirectory>
<sources>
<source>${project.basedir}/src/main/resources/schema/SITA_AIP_Message.xsd</source>
</sources>
<externalEntityProcessing>true</externalEntityProcessing>
<clearOutputDir>false</clearOutputDir>
</configuration>
</plugin>
Maven插件如下:
<xs:complexType name="GenericFieldValue">
<xs:choice>
<xs:element name="String" nillable="true">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:string"/>
</xs:simpleContent>
</xs:complexType>
</xs:element>
</xs:choice>
</xs:complexType>
<xs:element name="Value">
<xs:complexType>
<xs:complexContent>
<xs:extension base="aip:GenericFieldValue">
<xs:attribute name="Type" type="aip:GenericDataFieldType" use="required"/>
</xs:extension>
</xs:complexContent>
</xs:complexType>
</xs:element>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>jaxb2-maven-plugin</artifactId>
<version>2.4</version>
<executions>
<execution>
<id>xjc</id>
<goals>
<goal>xjc</goal>
</goals>
</execution>
</executions>
<configuration>
<outputDirectory>${project.basedir}/src/main/java/schema</outputDirectory>
<sources>
<source>${project.basedir}/src/main/resources/schema/SITA_AIP_Message.xsd</source>
</sources>
<externalEntityProcessing>true</externalEntityProcessing>
<clearOutputDir>false</clearOutputDir>
</configuration>
</plugin>
org.codehaus.mojo
我已经阅读了所有可用的答案,但没有任何东西帮助我知道如何修复此错误