How to auto reload app engine dev server?
NickName:sthomps Ask DateTime:2014-07-29T13:11:53

How to auto reload app engine dev server?

Im following the tutorial on the App Engine website for 'Google Cloud Endpoints' in Java. Everything works fine and I can run the development server using mvn appengine:devserver. The problem is that when I make any changes to a file (for example, any java file) the dev server doesnt automatically recompile. I need to ctrl-c to kill the dev server and restart it for every code change I make.

Is there a way to have maven automatically detect changes to any files in my project and have it automatically rebuild and restart the dev server?

Copyright Notice:Content Author:「sthomps」,Reproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/25008594/how-to-auto-reload-app-engine-dev-server

Answers
Patrice 2014-07-30T13:37:22

Unfortunately no. If you want this behavior on your dev server, you need to use Python.\n\nI run in the same issue and there is no real workaround provided by the App Engine to help you doing this.\n\nFrom the \"Using The Google plugin for Eclipse\": \n\n\n \n With Eclipse, you can leave the server running in the debugger while you make changes to source code, JSPs, static files and appengine-web.xml. When you save changes to source code, Eclipse compiles the class automatically, then attempts to insert it into the running web server dynamically. In most cases, you can simply reload the page in your browser to test the new version of the code. Changes to JSPs, static files and appengine-web.xml are recognized by the development server automatically, and also take effect without restarting the server. If you change web.xml or other configuration files, you must stop and start the server for the changes to take effect.\n \n\n\n(https://developers.google.com/appengine/docs/java/tools/eclipse#Running_the_Project)\n\nThere is NOTHING comparable in Java (link from \"The Java Development Server\") (https://developers.google.com/appengine/docs/java/tools/devserver)",


Don McCurdy 2015-09-03T04:20:16

There's currently nothing in the App Engine SDK to automatically restart when files change, but that's not to say you can't do it. I ran into the same problem and wrote up a script to listen for file changes as triggers to restart App Engine. It's in JavaScript, so you'll need to install Node.js if you haven't already.\n\n// Install watch-exec\n$ npm install -g watch-exec\n\n// Watch the current directory\n$ watch-exec --command \"mvn appengine:devserver\" --watch .\n\n\nThis will immediately start App Engine, and then restart it any time a file changes. If the app crashes for some reason, the script will wait for your next edit before trying to restart.\n\n\n\nP.S. That entire script is about 40 lines of code, and you could probably do the same thing in other scripting languages. If you haven't tried writing your own automation before, I'd definitely recommend checking out the source code to see how this works.",


Neill 2017-02-12T13:38:15

I've found using Gradle, GAE, and Spring MVC, the assemble command will put the correct artifacts in place, and the server will re-init the app. It's a little quicker than a server restart.",


More about “How to auto reload app engine dev server?” related questions

How to disable webpack dev server auto reload?

I know most people have the opposite problem but I actually want to disable the auto reload functionality. This is how I run my server: webpack-dev-server --open --progress This is my dev server

Show Detail

How to auto reload app engine dev server?

Im following the tutorial on the App Engine website for 'Google Cloud Endpoints' in Java. Everything works fine and I can run the development server using mvn appengine:devserver. The problem is that

Show Detail

Rails Engine: How to auto reload class upon each request?

I'm working on a Rails engine that allows the implementer to put classes in app/snippets. From within the engine, I want to instruct the host Rails app to auto reload classes in app/snippets upon ...

Show Detail

Adding dev server to App-Engine

My android app is backed by an App-Engine server. All good. Now I need to have a dev/staging server that I can use for testing. So I go with the obvious: create two App-Engine projects: one for

Show Detail

Google App Engine dev app server does not display detailed error message

When developing on Google App Engine dev app server locally (python) and encounter an error, the browser will just show something like the following: Server error The website encountered an error ...

Show Detail

Prevent App Engine hot reload on change in PyCharm .idea folder

The App Engine local dev server reloads every time there's a change to files - which is cool. What's uncool is that it also reloads on changes in .idea folder of the PyCharm editor, cluttering the ...

Show Detail

how to create dev server on app-engine

I have a server running on app-engine. I am working on version 2 of my server, which serves as the backend for a mobile app. How do I a dev and a staging server so that I can test before replacing ...

Show Detail

Dev server test for app engine when communicating with other server

I'm using Google App Engine Standard to write a small application, let's call it AppX. AppX is supposed to receive a POST message from another website, let's say B, and then do some processing and ...

Show Detail

Does expo-dev-client build auto reload?

I'm trying to use expo-dev-client to develop my app. The app hasn't contained native dependency yet. After following the set up in the Expo document, I lasted run the command '''eas build --platfor...

Show Detail

Web Dev Middleware auto reloading

I'm trying to auto-reload (no hot-reloading) some JavaScript through webpack-dev-middleware. Current code for my Express server: app.use(webpackDevMiddleware(compiler, { inline: true, noI...

Show Detail