我正在尝试使用maven在Java 6下使用jaxb2-maven-plugin从java类生成模式文件。通常它工作正常。
但另外我使用jaxb-facets分叉以支持完整的架构功能。通常jaxb-facets需要覆盖标准的jaxb实现才能工作。但这似乎是问题所在。使用jaxb2-maven-plugin时,插件总是下载原始的jaxb实现。我尝试使用背书策略,但似乎没有区别。
我疯了几个小时: - ((这是我的pom文件的相关部分:
<!-- The jaxb-facets depedencies: Note that jaxb-facets should be at the top of all dependencies (at least before any dependencies to JAXB libraries) -->
<dependency>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
<version>2.2.7-facets-1.0.3</version>
</dependency>
<dependency>
<groupId>com.sun.xml.bind</groupId>
<artifactId>jaxb-xjc</artifactId>
<version>2.2.6</version>
</dependency> ...
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>jaxb2-maven-plugin</artifactId>
<version>1.5</version>
<configuration>
<argline>-Djava.endorsed.dirs="${project.build.directory}/endorsed"</argline>
</configuration>
<executions>
<execution>
<goals>
<goal>schemagen</goal>
</goals>
<phase>generate-resources</phase>
<configuration>
<includes>
<include>de/dvka/avaro/model/schema/*.java</include>
</includes>
<outputDirectory>src/main/java/de/dvka/avaro/model/schema</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>