带有 castor-maven-plugin 的 castor 的多个 XSD 模式

Multiple XSD schemas for castor with castor-maven-plugin

是否可以同时使用多个 xsd 模式与 castor-maven-plugin?

我在 POM 中轮流使用它(schema1 和 schema2)并且它有效:

<build>
    ...
    <plugins>
        <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>castor-maven-plugin</artifactId>
            <version>2.1</version>
            <configuration>
                <schema>src/main/castor/schema1.xsd</schema>
                <dest>src/main/java</dest>
                <packaging>com.path.to.schema1.beans</packaging>
            </configuration>
            <executions>
                <execution>
                    <goals>
                        <goal>generate</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>

...

有一个小问题:mvn:install 收集所有 类 目标,除了 chema2.crd(如果我使用 schema2,则为 schema1)。我必须手动复制文件。

我可以修复它吗?有什么方法可以配置 castor-maven-plugin 吗?

尝试像这样使用多次执行:

<plugin>
    <groupId>org.codehaus.mojo</groupId>
    <artifactId>castor-maven-plugin</artifactId>
    <version>2.1</version>
    <executions>
        <execution>
            <id>firstSchema</id>
            <goals>
                <goal>generate</goal>
            </goals>
            <configuration>
              <schema>src/main/castor/schema1.xsd</schema>
              <dest>src/main/java</dest>
              <packaging>com.path.to.schema1.beans</packaging>
            </configuration>
        </execution>
        <execution>
            <id>secondSchema</id>
            <goals>
                <goal>generate</goal>
            </goals>
            <configuration>
              <schema>src/main/castor/schema2.xsd</schema>
              <dest>src/main/java</dest>
              <packaging>com.path.to.schema2.beans</packaging>
            </configuration>
        </execution>
    </executions>
</plugin>