Maven JAXB 插件的区别 [英] Difference of Maven JAXB plugins

查看:48
本文介绍了Maven JAXB 插件的区别的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经确定两个 JAXB 插件用于 Maven 2 存在,具有一些不同的配置.

一个来自Sun:http://jaxb.dev.java.net/jaxb-maven2-plugin/,另一个来自 Mojohaus:http://mojohaus.org/jaxb2-maven-plugin/

可以推荐这两个插件中的哪个?

<小时>

谢谢马特.在我的小研究项目中,我发现还有一个来自 sunners 的插件:

com.sun.tools.xjc.maven2<artifactId>maven-jaxb-plugin</artifactId>

还有那个:

org.jvnet.jaxb2.maven2<artifactId>maven-jaxb2-plugin</artifactId>

仍然是 Codehouse 的那个.

解决方案

让我们总结一下.我们曾经/曾经:

  1. maven-jaxb2-plugin (https://github.com/highsource/maven-jaxb2-plugin)
  2. maven-jaxb-plugin (https://jaxb.dev.java.net/jaxb-maven2-plugin/)
  3. jaxb2-maven-plugin (https://github.com/mojohaus/jaxb2-maven-plugin)

基于这个线程,我一直使用maven-jaxb2-plugin(即插件#1):

<块引用>

关于org.jvnet.jaxb2.maven2:maven-jaxb2-plugin相对com.sun.tools.xjc.maven2:maven-jaxb-plugin,从我的角度来看,这绝对是第一个(http://maven-jaxb2-plugin.java.net/)..>

这个插件有更多的功能比com.sun.tools.xjc.maven2:maven-jaxb-plugin,发展是活跃的.最后,我是作者之一 :) 我想说我们与 JAXB 开发人员保持联系和用户并对最新消息做出反应功能/请求.

事实上,插件#2 已经死了.因为我一直对#1 很满意,所以我从来没有使用过插件#3,所以不能说任何关于它的事情.以防万一,这里是插件 #1 的工作配置:

...<构建><插件><插件><继承的>真</继承的><groupId>org.apache.maven.plugins</groupId><artifactId>maven-compiler-plugin</artifactId><配置><来源>1.5</来源><目标>1.5</目标></配置></插件><插件><groupId>org.jvnet.jaxb2.maven2</groupId><artifactId>maven-jaxb2-plugin</artifactId><执行><执行><目标><目标>生成</目标></目标></执行></执行></插件></插件></build></项目>

I have determined that two JAXB plugins for Maven 2 exist, with some different configurations.

The one is from Sun: http://jaxb.dev.java.net/jaxb-maven2-plugin/, the other from Mojohaus: http://mojohaus.org/jaxb2-maven-plugin/

Which of these two plugins can be recommended?


Thanks Matt. On my little research project, I found that there's quite another plugin comming from the sunners:

<groupId>com.sun.tools.xjc.maven2</groupId>  
<artifactId>maven-jaxb-plugin</artifactId>  

and that one:

<groupId>org.jvnet.jaxb2.maven2</groupId>
<artifactId>maven-jaxb2-plugin</artifactId>

and still the one from Codehouse.

解决方案

Let's summarize. We have/had:

  1. the maven-jaxb2-plugin (https://github.com/highsource/maven-jaxb2-plugin)
  2. the maven-jaxb-plugin (https://jaxb.dev.java.net/jaxb-maven2-plugin/)
  3. the jaxb2-maven-plugin (https://github.com/mojohaus/jaxb2-maven-plugin)

Based on the comments of this thread, I've always used the maven-jaxb2-plugin (i.e. plugin #1):

Concerning the org.jvnet.jaxb2.maven2:maven-jaxb2-plugin versus com.sun.tools.xjc.maven2:maven-jaxb-plugin, from my point of view it's definitely the first one (http://maven-jaxb2-plugin.java.net/).

This plugin has much more features than com.sun.tools.xjc.maven2:maven-jaxb-plugin, the development is active. Finally, I'm one of the authors :) and I'd say we keep in touch with JAXB developers and users and react to the latests features/requests.

And indeed, the plugin #2 is dead. And because I've always been happy with #1, I've never used plugin #3 so can't really say anything about it. Just in case, here is a working configuration for plugin #1:

<project>
  ...
  <build>
    <plugins>
      <plugin>
        <inherited>true</inherited>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <configuration>
          <source>1.5</source>
          <target>1.5</target>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.jvnet.jaxb2.maven2</groupId>
        <artifactId>maven-jaxb2-plugin</artifactId>
        <executions>
          <execution>
            <goals>
              <goal>generate</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
</project>



    

这篇关于Maven JAXB 插件的区别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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