2

这是我的插件:

       <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>jaxb2-maven-plugin</artifactId>
        <executions>
            <execution>
                <id>schemagen</id>
                <goals>
                    <goal>schemagen</goal>
                </goals>
            </execution>
        </executions>
    </plugin>

这是根元素:

@XmlRootElement(name = "FooBar")
@XmlAccessorType(XmlAccessType.FIELD)
public class FooBarEnvelope {
   //other elements not listed
}

当我运行 maven 时,它会生成这个 xsd:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<xs:schema version="1.0" xmlns:xs="http://www.w3.org/2001/XMLSchema">

    <xs:element name="FooBar" type="FooBarEnvelope"/>
    <!-- other elements -->
</xs:schema>

它工作得很好,但现在我想设置模式的版本:

<xs:schema version="5.2.0" xmlns:xs="http://www.w3.org/2001/XMLSchema">

我怎样才能做到这一点?

4

0 回答 0