[英]Is there a fix for the jaxb2-maven-plugin:schemagen to work with JDK8?
[英]Can I include java source from multiple projects when running schemagen using the jaxb2-maven-plugin?
我有一個多模塊maven項目,我需要從JaxB注釋類構建XML模式。 這些類在不同的Maven項目中。 我可以使用jaxb2-maven-plugin通過指向所有項目的源代碼來生成單個模式嗎? 也許像這樣...
<configuration>
...
<includes>
<include>../OtherProj1/src/main/java/**/*.java</include>
<include>../OtherProj2/src/main/java/**/*.java</include>
<include>**/*.java</include>
</includes>
...
</configuration>
還是我需要為每個項目分別創建一個架構,然后將其導入父架構?
我正在使用Maven 2.2.1和jaxb2-maven-plugin 1.3。
我認為antrun插件是包含來自mvn項目外部的源以生成XML模式的唯一方法。
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.6</version>
<executions>
<execution>
<phase>generate-resources</phase>
<configuration>
<target>
<taskdef name="schemagen" classname="com.sun.tools.jxc.SchemaGenTask">
</taskdef>
<schemagen destdir="src/main/resources/" includes="<comma separated paths to include>"
excludes="<comma separated paths to exclude>">
<src path="src/main/java" />
<src path="../OtherProj1/src/main/java" />
<src path="../OtherProj2/src/main/java" />
</schemagen>
<move file="src/main/resources/schema1.xsd" tofile="src/main/resources/<filename>.xsd" />
</target>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.