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 Auto Reload
enabled [Started, Synchronized]
(sometimes [Started, Restart]
) Synchronized
Build Automatically
enabled. Build Project
with Build Automatically
disabled) rarely causes a redeploy. 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. 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
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.