问题描述
我已经确定两个 JAXB 插件用于 Maven 2 存在,具有一些不同的配置.
一个来自Sun:http://jaxb.dev.java.net/jaxb-maven2-plugin/,另一个来自 Mojohaus:http://mojohaus.org/jaxb2-maven-plugin/
可以推荐这两个插件中的哪个?
谢谢马特.在我的小研究项目中,我发现还有一个来自 sunners 的插件:
<artifactId>maven-jaxb-plugin</artifactId>
还有那个:
<artifactId>maven-jaxb2-plugin</artifactId>
仍然是 Codehouse 的那个.
让我们总结一下.我们曾经/曾经:
- maven-jaxb2-plugin (https://github.com/highsource/maven-jaxb2-plugin)
- 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:
- the maven-jaxb2-plugin (https://github.com/highsource/maven-jaxb2-plugin)
- 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):
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 插件的区别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!