这是我的插件:
<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">
我该怎么做?