简体   繁体   English

net.ltgt.gwt.maven和org.codehaus.mojo GWT Maven插件有什么区别?

[英]What is the difference between net.ltgt.gwt.maven and org.codehaus.mojo GWT Maven plugins?

Apparently, there are two maven plugins for GWT: 显然,GWT有两个maven插件:

This one: 这个:

<groupId>net.ltgt.gwt.maven</groupId>
<artifactId>gwt-maven-plugin</artifactId>
<version>1.0-rc-6</version>

and this one: 还有这个:

<groupId>org.codehaus.mojo</groupId>
<artifactId>gwt-maven-plugin</artifactId>
<version>2.8.0-SNAPSHOT</version>

What are the differences ? 有什么区别 ?

Disclaimer: I'm a former maintainer of the org.codehaus.mojo plugin, and author of the net.ltgt.gwt.maven one. 免责声明:我是一名前维护者org.codehaus.mojo插件,以及作者net.ltgt.gwt.maven之一。

The plugins have very different approaches to using GWT with Maven; 插件与使用Maven的GWT有很多不同的方法; I'll try to summarize the most important ones here. 我将尝试总结这里最重要的一些。

First, the org.codehaus.mojo is tied to a specific version of GWT; 首先, org.codehaus.mojo绑定到特定版本的GWT; this means a new version of the plugin has to be released whenever a new version of GWT is released to account for differences. 这意味着每当发布新版本的GWT以解决差异时,都必须发布新版本的插件。 On the other hand, it exposes all GWT options/flags right as configuration properties, with Maven documentation ( mvn gwt:help ) et al. 另一方面,它使用Maven文档( mvn gwt:help )等公开所有GWT选项/标记作为配置属性。 When a bug is fixed in the plugin, this also means you have to update your GWT version to match the one used by the next plugin release; 当插件中修复了一个错误时,这也意味着您必须更新您的GWT版本以匹配下一个插件版本使用的版本; while you really should always use the latest GWT version, it might not be possible to update quickly due to other dependencies being incompatible with the new version, etc. so you may be in "version conflict hell". 虽然你真的应该总是使用最新的GWT版本,但由于其他依赖项与新版本等不兼容,可能无法快速更新,因此你可能处于“版本冲突地狱”。
The net.ltgt.gwt.maven plugin aims at being compatible with the 2 latest versions of GWT, but is likely compatible with many more (it's just not tested / guaranteed); net.ltgt.gwt.maven插件旨在与2个最新版本的GWT兼容,但可能与更多版本兼容(它只是没有经过测试/保证); this means that you can update the plugin independently of GWT. 这意味着您可以独立于GWT更新插件。
The org.codehaus.mojo plugin brings the gwt-dev and gwt-user (and gwt-servlet !) dependencies, which can cause conflicts with those from the project's dependencies if not strictly identical; org.codehaus.mojo插件带来了gwt-devgwt-user (以及gwt-servlet !)依赖项,如果不是严格相同的话,它们可能会导致与项目依赖项的依赖项冲突; also, due to how Maven works, you cannot exclude them from the plugin's dependencies if you use your own forked version of GWT under a different groupId (you'd have to either use the com.google.gwt groupId , or fork the plugin to change its dependenceis). 另外,由于Maven的工作方式,如果您在不同的groupId下使用自己的GWT分叉版本,则不能将它们从插件的依赖项中排除(您必须使用com.google.gwt groupId ,或者将插件分叉到改变它的依赖性)。

The net.ltgt.gwt.maven plugin comes with custom packaging s for gwt-lib and gwt-app . net.ltgt.gwt.maven插件附带gwt-libgwt-app自定义packaging It's quite opinionated on how GWT apps should be done with Maven: separating client and server (and shared) code into separate Maven modules (this is actually following The Maven Way™: if you need separate classpaths, then you need to use different Maven modules, each with their dependencies). 关于如何使用Maven完成GWT应用程序的观点非常明确:将客户端和服务器(和共享)代码分离到单独的Maven模块中(这实际上遵循Maven Way™:如果您需要单独的类路径,那么您需要使用不同的Maven模块,每个都有他们的依赖)。 You're of course not forced to use those packagings, they just cut quite a bit of configuration in the POMs by setting appropriate defaults and conventions. 你当然不会被迫使用这些包装,他们只是通过设置适当的默认值和约定来在POM中削减相当多的配置。

Finally, because of that above-stated opinionated view on "project layout", the net.ltgt.gwt.maven plugin is designed to support multi-module (aka reactor) builds, contrary to the org.codehaus.mojo plugin where, for instance, gwt:run has to be run on a project where both client and server code "live"; 最后,由于上述关于“项目布局”的观点, net.ltgt.gwt.maven插件旨在支持多模块(又名反应堆)构建,与org.codehaus.mojo插件相反,其中,例如, gwt:run必须在客户端和服务器代码都“活动”的项目上运行; leading to awful hacks in multi-module builds like having to mvn install all dependency modules (because gwt:run cannot be invoked on the aggregator module) and using the build-helper-maven-plugin to bring in client sources from the other modules for seamless development experience. 导致多模块构建中的糟糕黑客,比如必须mvn install所有依赖模块(因为gwt:run不能在聚合器模块上调用)并使用build-helper-maven-plugin从其他模块引入客户端源代码无缝的开发经验。

You can see the differences between the plugins in this commit on the gwt-maven-archetypes ( disclaimer: I'm the author ) which switched from the org.codehaus.mojo to the net.ltgt.gwt.maven plugin. 您可以在gwt-maven-archetypes( 免责声明:我是作者 )上看到此提交中的插件之间的差异,该插件从org.codehaus.mojo切换到net.ltgt.gwt.maven插件。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 GWT 项目中的 tomcat-maven-plugin。 org.codehaus.mojo 和 org.apache.tomcat.maven 插件有什么区别 - tomcat-maven-plugin in GWT project. What is the difference between: org.codehaus.mojo and org.apache.tomcat.maven plugin net.ltgt.gwt.maven:gwt-maven-plugin with Lombok - net.ltgt.gwt.maven:gwt-maven-plugin with Lombok 无法执行目标org.codehaus.mojo:gwt-maven-plugin:2.6.1:compile - Failed to execute goal org.codehaus.mojo:gwt-maven-plugin:2.6.1:compile 使用“ org.apache.maven.plugins”和“ org.codehaus.mojo”手动更新Maven m2 - Manually update Maven m2 with “org.apache.maven.plugins” and “org.codehaus.mojo” 无法解决工件。 缺少:-------- 1)org.codehaus.mojo:gwt-maven-plugin:jar:1.3-SNAPSHOT - Failed to resolve artifact. Missing: -------— 1) org.codehaus.mojo:gwt-maven-plugin:jar:1.3-SNAPSHOT org.codehaus.mojo:jaxb2-maven-plugin 2.0在哪里? - Where is org.codehaus.mojo:jaxb2-maven-plugin 2.0? 在当前项目和插件组[org.apache.maven.plugins,org.codehaus.mojo]中未找到前缀为&#39;archetype&#39;的插件 - No plugin found for prefix 'archetype' in the current project and in the plugin groups [org.apache.maven.plugins, org.codehaus.mojo] local 在当前项目和插件组[org.apache.maven.plugins,org.codehaus.mojo]中找不到前缀为“ exec”的插件 - No plugin found for prefix 'exec' in the current project and in the plugin groups [org.apache.maven.plugins, org.codehaus.mojo] Java POM 插件问题(无法解析 mojo org.codehaus.mojo:exec-maven-plugin 的配置) - Java POM plugin issue (Unable to parse configuration of mojo org.codehaus.mojo:exec-maven-plugin) Maven:org.codehaus.mojo:tomcat-maven-plugin:jar:2.2的POM在哪里? - Maven: where is the POM for org.codehaus.mojo:tomcat-maven-plugin:jar:2.2?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM