Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/377.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java jaxb2 maven插件是否与带有simplify扩展的jaxb绑定兼容?_Java_Jaxb_Jaxb2 Maven Plugin_Jaxb2 Basics_Jaxb2 Simplify Plugin - Fatal编程技术网

Java jaxb2 maven插件是否与带有simplify扩展的jaxb绑定兼容?

Java jaxb2 maven插件是否与带有simplify扩展的jaxb绑定兼容?,java,jaxb,jaxb2-maven-plugin,jaxb2-basics,jaxb2-simplify-plugin,Java,Jaxb,Jaxb2 Maven Plugin,Jaxb2 Basics,Jaxb2 Simplify Plugin,我试图用org.codehaus.mojo:jaxb2maven-plugin:2.5.0从xsd模式生成java对象。 我不允许修改模式,因为这是供应商提供的 我试图通过选择jaxb绑定来简化complexType。 这是模式 <xs:complexType name="IdentificationType"> <xs:choice> <xs:sequence> &l

我试图用org.codehaus.mojo:jaxb2maven-plugin:2.5.0从xsd模式生成java对象。 我不允许修改模式,因为这是供应商提供的

我试图通过选择jaxb绑定来简化complexType。 这是模式

<xs:complexType name="IdentificationType">
        <xs:choice>
            <xs:sequence>
                <xs:element name="Identifier" nillable="false">
                    <xs:simpleType>
                        <xs:restriction base="IdentiferType">
                            <xs:minLength value="2"/>
                        </xs:restriction>
                    </xs:simpleType>
                </xs:element>
                <xs:element name="ProductNumber" type="ProductNumberType" nillable="false" minOccurs="0">
                </xs:element>
            </xs:sequence>
            <xs:element name="ProductNumber" type="ProductNumberType" nillable="false">
            </xs:element>
        </xs:choice>
    </xs:complexType>
如果没有简化,结果将是这样的

@XmlElementRefs({
        @XmlElementRef(name = "Identifier", namespace = "http://mynamespce.net/1", type = JAXBElement.class),
        @XmlElementRef(name = "ProductNumber", namespace = "http://mynamespce.net/1", type = JAXBElement.class)
    })
    @Generated(value = "com.sun.tools.xjc.Driver", date = "2020-09-08T10:10:41+10:00", comments = "JAXB RI v2.3.2")
    protected List<JAXBElement<? extends Serializable>> content;
@XmlElement(name = "Identifier")
    protected String Identifier;
    @XmlElement(name = "ProductNumber")
    protected ProductNumberType productNumberInSequence;
如何使用jaxb2 maven插件实现这一点

org.xml.sax.SAXParseException: Unsupported binding namespace "http://jaxb2-commons.dev.java.net/basic/simplify". Perhaps you meant "http://jaxb.dev.java.net/plugin/code-injector"?
@XmlElementRefs({
        @XmlElementRef(name = "Identifier", namespace = "http://mynamespce.net/1", type = JAXBElement.class),
        @XmlElementRef(name = "ProductNumber", namespace = "http://mynamespce.net/1", type = JAXBElement.class)
    })
    @Generated(value = "com.sun.tools.xjc.Driver", date = "2020-09-08T10:10:41+10:00", comments = "JAXB RI v2.3.2")
    protected List<JAXBElement<? extends Serializable>> content;
@XmlElement(name = "Identifier")
    protected String Identifier;
    @XmlElement(name = "ProductNumber")
    protected ProductNumberType productNumberInSequence;