简体   繁体   English

避免在 Eclipse 关闭后重新发布 Web 应用程序

[英]Avoid RePublishing the web application after Eclipse Shutdown

I am having my web application deployed on Tomcat5.5 and I use it in integration with eclipse 3.2.Each time I close the eclipse and restart it, I need to republish the application even when it hasn't been modified.我将我的 Web 应用程序部署在 Tomcat5.5 上,并将它与 eclipse 3.2 集成在一起使用。每次关闭 eclipse 并重新启动它时,我都需要重新发布该应用程序,即使它没有被修改。

Is there a way to avoid this or any step I am missing ?有没有办法避免这个或我遗漏的任何步骤?

Go to Preferences->Server->Launching .转到 Preferences->Server->Launching 。 Remove option 'Automatically Publish When Starting Server'删除选项“启动服务器时自动发布”

I think adij.wordpress.com correctly nailed this one.我认为 adij.wordpress.com 正确地解决了这个问题。 If you find that you're spending a lot of time waiting for Tomcat to restart as you develop your application, consider using Jetty instead.如果您发现在开发应用程序时花费了大量时间等待 Tomcat 重新启动,请考虑改用 Jetty。 It'll restart in a fraction of the time Tomcat does and provides a full featured alternative that is ideal for agile development.它将在 Tomcat 的一小部分时间内重新启动,并提供一个功能齐全的替代方案,非常适合敏捷开发。

We use Glassfish (Tomcat based) with multiple EAR files and it's dog slow for development so each EAR project contains a Jetty launcher that simply fires up for the single WAR the developer is working on at the time.我们使用带有多个 EAR 文件的 Glassfish(基于 Tomcat),它的开发速度很慢,所以每个 EAR 项目都包含一个 Jetty 启动器,它只是为开发人员当时正在处理的单个 WAR 启动。 If you use IntelliJ this can be made automatic so that changes at any tier of the application can be instantly reflected into the currently running application in the time it takes to click onto the browser and refresh the page.如果您使用 IntelliJ,这可以自动进行,以便在单击浏览器并刷新页面所需的时间内,应用程序任何层的更改都可以立即反映到当前运行的应用程序中。

eclipse 3.3 或 3.4 或更高版本的 WTP 对您的行为是否相同?

As this is a quite old question and still filed under unanswered, I'd like to broaden the scope with this answer:由于这是一个相当古老的问题并且仍然没有得到答复,因此我想通过以下答案扩大范围:

I assume there is a reason for you to want to cut out republishing of your application that I don't know (other than the aversion against unnecessary work being done)我认为您有一个理由想要停止重新发布我不知道的应用程序(除了反对完成不必要的工作)

The only thing I can guess is that it takes a significant amount of time.我唯一能猜到的是它需要大量的时间。 For me the publishing time has never been an issue, but if they are for you, you might think about对我来说,出版时间从来都不是问题,但如果它们是给你的,你可能会考虑

  • increasing your memory (if swapping virtual memory slows republishing) - eg buying new RAM增加内存(如果交换虚拟内存会减慢重新发布的速度) - 例如购买新的 RAM
  • optimize dependencies in your project, eg prepackage dependent projects if there's a huge number of them or create subprojects and depend upon them if there's only one huge project.优化项目中的依赖项,例如,如果依赖项数量众多,则预先打包依赖项;如果只有一个大型项目,则创建子项目并依赖它们。 (This assumes, that any of these factors slows republishing. I have not measured it) (这是假设,这些因素中的任何一个都会减慢重新发布的速度。我没有测量过)
  • does using Tomcat6 or glassfish help?使用 Tomcat6 或 glassfish 有帮助吗?

It might be, that not publishing is your issue but startup time.可能是,不是发布是您的问题,而是启动时间。 You might gain a lot by controlling that very tightly, eg starting services on demand after the webapplication has started.通过非常严格地控制,您可能会受益匪浅,例如在 web 应用程序启动后按需启动服务。 I know several applications that do some heavy work during startup (before they accept their first connection and before they pass control on to the next application startup that might do the same).我知道有几个应用程序在启动期间做了一些繁重的工作(在他们接受他们的第一个连接之前,在他们将控制权传递给可能做同样事情的下一个应用程序启动之前)。 I hate them.我恨他们。 Usually such services get lots of swear words and finally their own web/application server.通常这样的服务会得到很多脏话,最后是他们自己的网络/应用程序服务器。 Having to restart one of these applications should at least not make all the other applications (and their users) suffer that are written with nice startup times in mind.必须重新启动这些应用程序之一至少不应让所有其他应用程序(及其用户)受到影响,这些应用程序在编写时考虑了良好的启动时间。

If your question is still an issue and you are still looking for a solution, please comment.如果您的问题仍然存在并且您仍在寻找解决方案,请发表评论。 What is your republishing time?你的重新发布时间是什么时候?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM