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

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

问题描述

我已确定 JAXB 插件.wikipedia.org / wiki / Apache_Mavenrel =noreferrer> Maven 2存在,具有一些不同的配置。

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

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

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?

谢谢Matt。在我的小型研究项目中,我发现还有另外一个来自sunners的插件:

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>  

和那一个:

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

仍然来自Codehouse。

and still the one from Codehouse.

推荐答案

让我们总结一下。我们有:

Let's summarize. We have:


  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

  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)

根据这个帖子,我一直用 maven-jaxb2-plugin (即插件#1):

Based on the comments of this thread, I've always used the maven-jaxb2-plugin (i.e. 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开发人员保持联系
和用户并对最近的
功能/请求做出反应。

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.

事实上,插件#2不是很活跃(死了?)。因为我一直对#1感到满意,所以我从未使用插件#3,因此无法真正说出任何关于它的内容。以防万一,这是插件#1的工作配置:

And indeed, the plugin #2 isn't very active (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天全站免登陆