将tomcat和eclipse集成为热部署环境 [英] Integrating tomcat and eclipse as a hot-deploy environment

查看:107
本文介绍了将tomcat和eclipse集成为热部署环境的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想以集成的方式设置eclipse和tomcat,这样我的JSP和servlet的更改(如果可能的话)就会立即反映,而不需要部署。

I would like to setup eclipse and tomcat in an integrated fashion such that changes to my JSPs and servlets(if possible) are reflected immedietely without requiring a deployment.

好的,这是在互联网上有很多答案的问题之一,但都看起来不一样。 (使用Sysdeo插件,使用JBOss插件,使用过时的Eclipse,使用MyEclipse等),我找不到1个确定资源来引用。所以为了我的好处,最简单和最推荐的过程是什么?

Ok, this is one of those questions that has plenty of answers all across the internet but they all seem different. (use Sysdeo plugin, use JBOss plugin, do stuff with an outdated Eclipse, use MyEclipse instead etc.) and I couldn't find 1 definitive resource to refer to. So for my benefit, what is the simplest and most recommended procedure to set this up ?

这假设我有eclipse和tomcat独立运行。我实际上已经设法使用非热点部署方式将它们整合在一起:
http://www.ibm.com/developerworks/opensource/library/os-eclipse-tomcat/index.html

This assumes I have eclipse and tomcat running independently. I actually have managed to integrate them in a non-hot deploy fashion using instructions here : http://www.ibm.com/developerworks/opensource/library/os-eclipse-tomcat/index.html

Eclipse版本版本:3.4.2(Ganymede)
Tomcat v6.0.20

Eclipse version Version: 3.4.2 (Ganymede) Tomcat v6.0.20

推荐答案

有两个选项。

首先,Eclipse可以让您轻松更改配置(另请参见详细信息

First, Eclipse lets you do this, with a slight change of configuration (see also this detailed post)


  • 将Tomcat添加到服务器列表

  • 使项目动态Web项目(通过创建向导或设置中的facets部分)

  • 将项目添加到tomcat,并配置其部署程序集

  • 从列表中双击tomcat以打开配置

  • 将发布更改为从不自动发布(这意味着当您点击ctrl + s时,服务器不会重新启动)

  • 在调试模式下启动tomcat

  • add Tomcat to the server list
  • make the project "Dynamic web project" (Either through the creation wizard or through the facets section in the settings)
  • add the project to tomcat, and configure its "Deployment assembly"
  • double click tomcat from the list to open the configurations
  • Change "Publishing" to "Never publish automatically" (this means the server won't get restarted when you hit ctrl+s)
  • start tomcat in debug mode

这仍将反映代码更改,但不会重新启动服务器。

This will still reflect code changes but won't restart the server.

其次,我使用了 FileSync插件很长一段时间:

Second, I've used the FileSync plugin for a long time:


  • 配置插件,将所有类从bin导出器发送到 WEB-INF /

  • 将所有其他资源配置到各自的位置

  • 可选地,将文件同步位置设置的所有绝对路径外部化为单个变量,并在eclipse中配置该变量(因此,如果所有成员都使用eclipse,则还可以提交filesync设置)<将Tomcat添加到eclipse中的服务器列表中,将服务器位置选项配置为使用tomcat安装(从服务器列表双击tomcat时,该窗口将打开) li>
  • 在调试模式下启动tomcat

每个非结构性更改都会立即反映,无需重新部署。

It works perfectly for me that way. Every non-structural change is reflected immediately, without redeploy.

更新:

您可以阅读更多关于< a href =http://techblog.bozho.net/?p=1246 =noreferrer>在这里热部署的方法。

我也创建了一个项目,可以轻松地将工作区与servlet容器同步。

Update:
You can read more about the methods for hot-deploying here.
I also created a project that easily syncs the workspace with the servlet container.

这篇关于将tomcat和eclipse集成为热部署环境的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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