找不到文件:maven-jaxb2-plugin

时间:2011-09-29 13:35:13

标签: jaxb2 maven-jaxb2-plugin

我正在尝试使用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中找不到JAR条目index.xsd esp-schemas-1.0-SNAPSHOT

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

1 个答案:

答案 0 :(得分:1)

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