使用Maven hyperjaxb3插件包含多个XML模式

时间:2014-08-23 07:05:02

标签: hyperjaxb

我有3种不同的XML模式。我想生成对应于这3个XSD的类和ORM表。我正在使用Maven进行构建。

我使用的Maven Pom配置是:

<plugin>
    <groupId>org.jvnet.hyperjaxb3</groupId>
    <artifactId>maven-hyperjaxb3-plugin</artifactId>
    <version>0.5.6</version>
    <executions>
        <execution>
            <goals>
                <goal>generate</goal>
            </goals>
        </execution>
    </executions>
    <configuration>
        <args>
            <arg>-Xannotate</arg>
            <arg>-enableIntrospection</arg>
        </args>
        <schemaDirectory>src/main/resources</schemaDirectory>
        <bindingDirectory>src/main/resources</bindingDirectory>
        <persistenceXml>src/main/resources/event.xml</persistenceXml>
        <generateDirectory>${project.build.directory}/generated-sources/xjc</generateDirectory>
        <schemaIncludes>
            <include>EventML.xsd</include>
        </schemaIncludes>
        <specVersion>2.2</specVersion>
        <extension>true</extension>
        <variant>jpa2</variant>
        <persistenceUnitName>event</persistenceUnitName>
    </configuration>
</plugin>

我想再添加2个XSD。我怎么能这样做?

1 个答案:

答案 0 :(得分:2)

你可以改变这些行:

<schemaIncludes>
    <include>EventML.xsd</include>
</schemaIncludes>

对此:

<schemaIncludes>
    <include>EventML.xsd</include>
    <include>Other1.xsd</include>
    <include>Other2.xsd</include>
</schemaIncludes>