使用 Eclipse、Tomcat 和 Jetspeed 热部署开发变更
我正在开发一个在 Tomcat 上运行的 Jetspeed 门户应用程序,使用带有 Sysdeo Tomcat 启动器插件的 Eclipse IDE 来调试在 Tomcat/Jetspeed 中运行的应用程序。
我想知道如何为此环境启用开发更改的热部署?有谁知道如何配置 Jetspeed 门户 Web 应用程序以从 Eclipse 进行热部署?在网上确实找不到任何有关 Jetspeed 热部署的信息。
I am developing a Jetspeed portal application running on Tomcat, using the Eclipse IDE with the Sysdeo Tomcat launcher plugin to enable debugging of the application running in Tomcat/Jetspeed.
I was wondering how to enable hot deploy of development changes for this environment? Does anyone know how to configure a Jetspeed portal web application to be hot-deployed from Eclipse? Can't really find any information on the net for Jetspeed hot deployment.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
我通常创建一个 ant 构建文件,松散地基于:
http: //tomcat.apache.org/tomcat-6.0-doc/appdev/build.xml.txt
并使用“安装”/“删除”目标部署到远程 tomcat
类似问题:
从 Eclipse 远程部署 Tomcat webapp
如果您谈论的是仅在您的本地机器 - 你不需要外部插件来 eclipse,
它内置了对 Tomcat 和热重新部署的支持。
I usually create an ant build file, loosely based on:
http://tomcat.apache.org/tomcat-6.0-doc/appdev/build.xml.txt
and use the 'install'/'remove' targets to deploy to a remote tomcat
Similar question here:
Remote deploy Tomcat webapp from Eclipse
If you're talking about only developing on your local machine- you don't need an external plugin to eclipse,
it has built in support for Tomcat and hot redeployment.
您可能想看看 jrebel。我一直想自己看一下 - 根据我的理解,jrebel 可以更改源代码,然后能够立即在实时环境(例如 tomcat)中看到结果,而无需重新部署和/或重新启动服务。
You might want to take a look at jrebel. I've been meaning to take a look myself - From my understanding, jrebel makes it possible to make source code changes and then be able to immediately see the results in a live environment (such as tomcat) without redeploying and/or restarting services.
从您的问题来看,尚不完全清楚您是否想要部署 Jetspeed Portal 项目或 portlet 应用程序。第一个实际上是常规 Web 应用程序,理论上可以使用 Eclipse WTP 插件进行热部署。
如果您正在开发 portlet 应用程序,则情况会更复杂,因为它们不是直接部署到 Tomcat,而是部署到 Tomcat 中运行的 Jetspeed 部署(实际 /webapps/jetspeed-portal/WEB-INF/deploy )。
我使用的一个技巧是使用 Maven 构建脚本来部署应用程序。之后,您可以将 tomcat 对 portlet 的 web.xml 所做的修改复制到您的 web.xml 中并直接从 Eclipse 进行部署。
From your question it is not entirely clear if you want to deploy your Jetspeed Portal project or a portlet application. The first is in fact a regular web application and theoretically can be hot-deployed using the Eclipse WTP plugin.
If you are developing portlet applications, it is more complicated because they are not deployed to Tomcat directly, but to the Jetspeed deployement running in Tomcat (actual /webapps/jetspeed-portal/WEB-INF/deploy ).
A trick I used is deploying your application using your Maven build script. After that, you can copy the modifications made by tomcat to your web.xml of your portlet into your web.xml and deploy directly from Eclipse.
您可以使用内置(在 Java EE 版本中)服务器插件:
publishing
,或使用 FileSync插件。在那里,您可以知道项目中的哪些文件夹应该复制(实时)到计算机上的哪个目录(tomcat/webapps/yourapp)。如果您想将项目签入其他人将使用它的存储库,只需多一点努力,文件同步配置就可以独立于机器(仅使用一个参数作为 TOMCAT_ROOT)。我知道使用 FileSync 插件并未被普遍接受,而发布是最常见的选项,但 FileSync 为您提供了重新安排类和资源的额外自由。
You can use the bult-in (in the Java EE version) Servers plugin:
publishing
, or use the FileSync plugin. There you can tell which folders from your project should be copied (live) to what directory on your machine (the tomcat/webapps/yourapp). With a little more effort the filesync configuration can be made machine independent (only using one parameter as TOMCAT_ROOT), in case you want to check-in the project to a repository where others will use it.I'm aware that using the FileSync plugin is not generally accepted, and
publishing
is the most common option, but FileSync gives you additional freedom to rearrange your classes and resources.显然,它不是所有情况的解决方案,但简单的符号链接可以在许多情况下完成工作,即使在现在允许创建符号链接的 Windows XP 或 Windows 7 中也是如此。
我的解决方案描述于此处
Obviously it is not the solution for all the cases, but a simple symbolic link will do the job for many cases, even in windows xp or windows 7, that now permit the creation of symbolic links.
My solution is depicted here