构建 GWT 应用程序的最佳方法
将 GWT 应用程序构建到 .war 文件的最佳方法是什么?
我已经有一个 ant 文件来构建我的项目,但是,它非常丑陋且缓慢。我认为你们中的一个人有更好的选择...
谢谢
What is the best way I can use to build a GWT app to a .war file?
I already have one ant file to build my project, but, it is very ugly and slow. I think one of you have a better option...
thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我个人使用maven,但是嘿,每个人都有自己的。 (至少你没有使用Makefile)。
然而,编译 GWT 应用程序会很慢。 GWT编译器需要为常见的浏览器类型编译多种风格的javascript,即使是google工程师也无法影响物理定律(也许在下一个版本的guava中)。
我的项目编译了 6 个单独的迭代,并产生了 40MB 的战争。优点是一旦我陷入战争,Tomcat 的性能就击败了托管模式的性能。
I personally use maven, but hey, to each their own. (At least you're not using a Makefile).
However, compiling a GWT application is going to be slow. The GWT compiler needs to compile multiple flavors of javascript for common browser types, and even the google engineers can't affect the laws of physics (maybe in the next release of guava).
My project compiles 6 separate iterations, and produces a 40MB war. The advantage was once I had it into a war, performance in Tomcat blew away the performance of hosted mode.
使用行家。它经过验证并通常用于构建 java 和 GWT 项目。
http://maven.apache.org/
您应该使用 GWT maven 插件:http://mojo.codehaus.org/gwt-maven-plugin/
但您应该注意:GWT 构建是总是很慢(取决于代码 数量)。因此,您必须仅将完整构建用于生产目的。在 Maven 中,您只能运行特定的子任务并可以添加配置文件。有关更多信息,请阅读插件文档。
UPD:
事实并非如此。但对于常见的开发过程,您不需要每次都运行 GWT 编译。当您在调试模式下运行 GWT 时,它会在托管模式下运行。因此您不必浪费时间进行频繁的重建。
Use maven. It's proven and commonly used to build java and GWT projects.
http://maven.apache.org/
You should use GWT maven plugin: http://mojo.codehaus.org/gwt-maven-plugin/
But you should be aware: GWT builds are always slow (depending on code amount). For thus you have to use full build only for production purposes. In maven you can run only specific subtasks and can add profiles. For more info read plugin documentation.
UPD:
This is really not so. But for common development process you don't need to run GWT compile each time. When you running GWT in debug mode - it runs in hosted mode. So you haven't to waste your time on often rebuilds.
我创建了一个比以前更好的 ant 构建,完整的代码是:
它需要在 war 文件夹中一个名为“server_resources”的文件夹。
这个解决方案对我来说非常有用。
I create a better ant build than I have before, the complete code is:
It needs a folder called "server_resources" in the war folder.
This solution works great for me.