gwt maven 项目风格:WebAppCreator 或 gwt-maven-plugin-Archetype - 使用什么 [英] gwt maven project flavors: WebAppCreator or gwt-maven-plugin-Archetype - what to use

查看:10
本文介绍了gwt maven 项目风格:WebAppCreator 或 gwt-maven-plugin-Archetype - 使用什么的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要一个 gwt 项目的 maven 项目配置.配置应该在 Eclipse (3.7!?) 和控制台 (mvn, jenkins...) 中运行.

I need a maven project configuration for a gwt project. The configuration should run in Eclipse (3.7!?) and from console (mvn, jenkins...).

我尝试了通过 gwt 交付的 webAppCreator:

I tried webAppCreator delivered with gwt:

webAppCreator.cmd -noant -maven -XnoEclipse -out WebAppCreated com.example.MyApp

和 gwt-maven-plugin 原型.这两个项目在 Eclipse 中看起来非常相似,但它们有非常不同的配置(不同的目录,使用不同的插件).我认为如果项目发展(添加测试、资源......),他们的行为会大不相同.因为原型配置要小得多,我认为它更接近 Maven 约定 - 但这也更好吗?

And gwt-maven-plugin Archetype. Both project look very similar in Eclipse but they have very different configurations (different directories, and use of different plugins). I think they will behave very different if project evolves (adding tests, resources...). Because the archetype configuration is much smaller i would think it's closer to maven conventions - but is this also better?

两种配置的有效区别是什么?

What are the effective differences of both configurations?

您建议以什么配置作为起点?

And what configuration would you suggest as starting point?

推荐答案

我总是从头开始创建 POM,但如果你问我,我可能会选择由工件生成的 POM.

I always create POMs from scratch, but if you'd ask me, I'd probably choose the POM generated by the artifact.

WebAppCreator 生成的 POM 在 target/www 中启动 DevMode,这很奇怪,它包含一个根本不需要的 maven-clean-plugin 配置(你不应该使用 src/main/webapp 作为你的 war 目录来启动 DevMode,所以没有必要清理它)

The POM generated by the WebAppCreator launches the DevMode in target/www, which is weird, and it includes a maven-clean-plugin configuratin that simply is not needed (you shouldn't ever launch the DevMode using src/main/webapp as your war directory, so there's no need to clean it up)

另一方面,工件生成的 POM 使用了 IMO 不需要的 i18ngenerateAsync 目标(它们可以用作 one shot 工具,但不要在每个构建中运行;尤其是 i18n 目标).

The POM generated by the artifact on the other hand uses the i18n and generateAsync goals which IMO are not needed (they can be useful as one shot tools, but not to be run on each build; particularly the i18n goal).

如果你问我,它们都不是一个好的起点,但是这个工件没有 WebAppCreator 坏.

If you ask me, none of them is a good starting point, but the artifact is less bad than the WebAppCreator.

我开始研究新的原型:https://github.com/tbroyer/gwt-maven-archetypes 他们还没有完全准备好,但他们已经比 gwt-maven-plugin 原型或 更好WebAppCreator.

I started working on new archetypes: https://github.com/tbroyer/gwt-maven-archetypes They're not totally ready yet, but they're IMO already better than the gwt-maven-plugin archetype or the WebAppCreator.

这篇关于gwt maven 项目风格:WebAppCreator 或 gwt-maven-plugin-Archetype - 使用什么的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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