简体   繁体   中英

Eclipse Tomcat Build Publishing slow

Setup

I have a project in Eclipse that I want to deploy to a local Tomcat server. The project was part of a git repo. I cloned the repo and imported the project. I then installed Web Tools, created the server, etc.. The only change I made to .classpath was removing two libs and changing the container (jre) to use the workplace default.

The project is very small and the build time is milliseconds. There is never any activity indicators or anything in the Progress view. The server is local so there should be no delays there.

On the server:

  • Modules auto reload by default is checked
  • Automatically publish when resources change is selected
  • Publishing interval (in seconds) is 1
  • My module has Auto Reload enabled
  • The server is shown as [Started, Synchronized] (sometimes [Started, Restart] )
  • My module is shown as Synchronized


Symptoms

  • Modifying source and saving causes a redeploy after a delay of up to 5 seconds (too slow!) when I have Build Automatically enabled.
  • A manual build ( Build Project with Build Automatically disabled) rarely causes a redeploy.
  • A manual publish (right-clicking the server and selecting Publish ) usually causes a redeploy if done after a manual build that did not redeploy. There can be a couple second delay on this as well.
  • Restarting the server doesn't help.
  • Restarting Eclipse does not help.


Question

Optimally I would like to auto-deploy right after saving changes to my source instead of having to wait 5 seconds for it to redeploy. The problem seems to be with the interval at which Build Automatically checks to see if it needs to build. Is there a way to shorten this?

Why does Build Automatically always cases a redeploy but Build Project rarely does?

Why is there a delay between when I manually publish and when the redeploy actually begins? Is there a way to fix/shorten this?

I didn't think Build Automatically would be necessary given the server's Automatically publish when resources change property. What is this for?


Thanks, - Mike



OSX 10.8.5

Eclipse Standard/SDK
Version: Kepler Service Release 2
Build id: 20140224-0627

Tomcat v7

We eventually managed to resolve (at least one variant) of the 'Eclipse slow publishing issue' as being an issue with m2e-wtp . We found the mappings it uses under .settings/org.eclipse.wst.common.component . We then modified these mappings to copy individual webapp folders one-at-a-time. Specifically, we avoided copying very large, nested folders such as node_modules .

After editing the file and refreshing the Eclipse project, the publishing pause is gone! You have to be careful that future changes (such as doing Maven > Update Project ) do not override the .settings/org.eclipse.wst.common.component file.

You can configure Eclipse's build folder (for any generated class files) to save directly to the deployed web app's classes folder. This essentially skips the deploy step.

Then, if you add a script / step to touch a watched resource (like web.xml ) each time you want to review your changes, it'll reload the context with the new class files in its class path. This generally takes about a second.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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