Play Framework 2 only recompiles from the first request

I use PlayFramwework 2.1.1 with Scala, and I created a small test server that I run locally ( play run from the console). If I change something while the server is running, these changes will not be recompiled and “redeployed” until the first request is reached ( curl "http://localhost:9000" , for example).

Is there a way to update the server when saving, for example, on Tomcat? Thanks.

+4
source share
3 answers

Yeah. Run it with play ~run . (pay attention to the tilde.) Thus, the files will be automatically recompiled after they are saved.

+5
source

This is a common use case.

play run waiting for a request to compile the changes (therefore, it compiles on the first request immediately after the changes)

play ~run after saving changes

Keep in mind that this is due to price increases and processor consumption, therefore, although development is not always a desirable situation.

+5
source

Also check out James Ward Play-auto-refresh , which updates the browser on save.

0
source

Source: https://habr.com/ru/post/1486172/


All Articles