Maven中同一项目的maven-jaxb2-plugin剧集可能吗? [英] maven-jaxb2-plugin episode of same project in Maven, possible?
问题描述
我有一个 basic.xsd
和另外两个 A.xsd
和 B. XSD
。 A.xsd
和 B.xsd
转换成两个不同的java包,因此我需要两个相同的Maven执行插件。
I have a basic.xsd
and two other A.xsd
and B.xsd
. A.xsd
and B.xsd
get converted into two different java packages, therefore I need two Maven executions of the same plugin.
对于某些共享类,两个XSD都引用 basic.xsd
。如果 basic.xsd
来自不同的项目,我可以通过使用剧集
来解决这个问题,以防止重复的课程。
Both XSDs refer to basic.xsd
for some shared classes. If basic.xsd
would come from a different project I could solve this problem really nicely through using episodes
to prevent duplicate classes.
但我如何参考当前项目?
But how can I refer to the current project?
我第一次执行插件只是生成从 basic.xsd
到自己的java命名空间的类。之后 A.xsd
和 B.xsd
的执行应该知道从 basic.xsd
。
My first execution of the plugin is to generate only classes from basic.xsd
into its own java namespace. After that the executios of A.xsd
and B.xsd
should know about the stuff generated from basic.xsd
.
我可以某种方式指向生成的 basic.xsd $ c $剧集c>?
Can I somehow point to the generated episode of basic.xsd
?
像
< episodes>< episodeFile> basicXSD .episode< / episodeFile< / episodes>
会很好,但就我所知,我只能添加依赖...: - (
<episodes><episodeFile>basicXSD.episode</episodeFile</episodes>
would be nice, but as far as I can see, I can only add dependencies... :-(
推荐答案
<plugin>
<groupId>org.jvnet.jaxb2.maven2</groupId>
<artifactId>maven-jaxb2-plugin</artifactId>
<version>0.8.1</version>
<executions>
<execution>
<id>first</id>
...
<configuration>
<episodeFile>${some.path}/first.episode</episodeFile>
</configuration>
</execution>
<execution>
<id>second</id>
...
<configuration>
<args>
<arg>-b</arg>
<arg>${some.path}/first.episode</arg>
</args>
</configuration>
</execution>
</executions>
</plugin>
http://docs.oracle.com/javase/6/docs/technotes/tools/share/xjc.html
< a href =http://weblogs.java.net/blog/kohsuke/archive/2006/09/separate_compil.html =nofollow> http://weblogs.java.net/blog/kohsuke/archive/ 2006/09 / separate_compil.html
这篇关于Maven中同一项目的maven-jaxb2-plugin剧集可能吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!