无法在带有嵌入式Tomcat的Eclipse中运行Mavenized GWT应用程序 [英] Unable to run mavenized GWT application in eclipse with embedded Tomcat

查看:64
本文介绍了无法在带有嵌入式Tomcat的Eclipse中运行Mavenized GWT应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在研究GWT 2.4/Spring 3.1/Maven 3/Eclipse Indigo项目的概念证明.我可以使用嵌入式Jetty服务器在开发模式下运行该应用程序.我能够创建战争(借助gwt-maven-plugin的mvn软件包),并在已安装的Tomcat服务器上运行该应用程序.但是,当我尝试Run as > Run on Server时,它不使用/复制生成/编译的JavaScript.当我进入wtpwebapps目录时,除了生成/编译的JavaScript外,所有内容都在那里.看起来,生成/编译的JavaScript在maven目标目录中的正确位置,但是将应用程序代码复制到wtpwebapps目录的eclipse进程并没有选择它.

I have a proof of concept GWT 2.4 / Spring 3.1 / Maven 3 / Eclipse Indigo project that I have been working on. I am able to run the application in Dev Mode using the embedded Jetty server. I am able to create a war (mvn package with help of the gwt-maven-plugin) and run the application on an installed Tomcat server. But when I try to Run as > Run on Server, it does not use/copy the generated/compiled JavaScript. When I go to the wtpwebapps dir, all is there but the generated/compiled JavaScript. The generated/compiled JavaScript is in the correct location in the maven target dir, it seems, but the eclipse process that copies the code the applcation to the wtpwebapps dir doesn't pick it up.

我不确定是否需要提供更多信息来解决此问题,但是可以提供任何帮助.

I'm not sure if I need to give more info to solve this problem, but any help is appreciated.

推荐答案

您可以通过嵌入式Tomcat API使用自定义的com.google.gwt.core.ext.ServletContainerLauncher,或者更简单地在Tomcat中运行服务器代码(使用WTP或tomcat7-maven-插件),然后在-noserver模式下运行DevMode.

You could use a custom com.google.gwt.core.ext.ServletContainerLauncher using the embedded Tomcat API, or much more simply run your server code in Tomcat (using WTP or the tomcat7-maven-plugin) and then run DevMode in -noserver mode.

请参见 https://developers.google.com/eclipse/docs/faq#gwt_with_maven https://developers.google.com/web-工具包/doc/latest/DevGuideCompilingAndDebugging#How_do_I_use_my_own_server_in_development_mode_instead_of_GWT

我在 https://github.com/tbroyer/gwt- Maven原型
原型现在使用Jetty,但是我已经成功地在基于原型的项目上使用了tomcat7-maven-plugin(有太多技巧使我无法将其设置为原型中的默认值;这些技巧仅是因为项目的多模块性质;但是Jetty也有技巧).

I'm using the second approach in https://github.com/tbroyer/gwt-maven-archetypes
The archetype uses Jetty for now, but I'm successfully using the tomcat7-maven-plugin on a project based on the archetype (with too many tricks preventing me to set it as the default in the archetype; those tricks only being needed because of the multi-module nature of the project; but there are tricks for Jetty too).

这篇关于无法在带有嵌入式Tomcat的Eclipse中运行Mavenized GWT应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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