Maven中同一项目的maven-jaxb2-plugin剧集可能吗? [英] maven-jaxb2-plugin episode of same project in Maven, possible?

查看:141
本文介绍了Maven中同一项目的maven-jaxb2-plugin剧集可能吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个 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

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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆