0

我正在尝试使用 jaxb2 插件从工件(依赖项)编译架构,我遵循了主题:从 Maven 工件编译架构

http://confluence.highsource.org/display/MJIIP/User+Guide#UserGuide-UsingcustomJAXB2plugins

我的代码是

<plugin>
                <groupId>org.jvnet.jaxb2.maven2</groupId>
                <artifactId>maven-jaxb2-plugin</artifactId>
                <executions>
                    <execution>
                        <goals>
                            <goal>generate</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <forceRegenerate>true</forceRegenerate>
                    <generatePackage>com.xxx.it.esp.subscription.schema</generatePackage>
                    <generateDirectory>src/main/java/</generateDirectory>
                    <!-- 
                    <schemas>
                        <schema>
                            <dependencyResource>
                                <groupId>com.xxx.it.esp</groupId>
                                <artifactId>esp-schemas</artifactId>
                                <version>1.0-SNAPSHOT</version>
                                <resource>index.xsd</resource>
                            </dependencyResource>
                        </schema>
                    </schemas>
                </configuration>
            </plugin>

引起:java.io.FileNotFoundException: JAR entry index.xsd not found in the jar esp-schemas-1.0-SNAPSHOT

顺便说一下 index.xsd 在 src/main/resources/schema/ 文件夹下,我也尝试给整个文件夹,但同样的错误

4

1 回答 1

1

请尝试<resource>schema/index.xsd</resource>resource是 JAR 中 XSD 的路径。

于 2011-09-30T10:01:25.880 回答