Automatic updates cannot be performed using only one additional devserver. Strictly speaking, we need to wait.
But you can achieve the effect of seamlessly updating html / js / css / etc, hot-swapping Java code, etc. with the configuration below.
Configure Apache httpd or Nginx to serve static code directly from your military source and route to the servlet application engine. In my case, all html is available directly from the webapp directory, and servlets are called via / sim /. Using the nginx port and 7070, my working nginx configuration looks like this:
server { listen 7070; root /home/pchauhan/Projects/my-company/my-mvn-gae-project/my-mvn-gae-project-war/src/main/webapp; location /sim/ { proxy_pass http://localhost:8080/sim/; } }
Use this nginx documentation for more configurations.
Configure Eclipse and GAE separately.
- Now you can directly make changes to the source and update them both for html (via nginx) and for servlets (via devserver).
- Add this webapp folder to your Chrome Dev tools, Workspace sources and life will be easier. Small changes can be saved directly from chrome to src via ctrl
Please note that although this is great, you should only test your application once on 8080 (devserver port) before downloading, just in case there is an error in the maven configuration and the target is not created / served correctly.
An alternative idea for synchronization . If you don't want to use nginx / httpd for any reason, you can add the target ... webapp to the Chrome workspace, work right there for a seamless update, and then use lsyncd to sync the target back to src. I haven't tried it yet, but it looks doable, albeit a bit risky.
Poojac20
source share