need
In project development using spring-boot, the project starts "very" slow. How painful it would be if you need to restart the project after each modification of the code or static resource file. How to make the project "restart" instantly when it changes again
Bring out
spring-boot-devtools The spring module can solve this requirement, even exceed the expected functions. The biggest feature is that the project will be "restarted instantly" as long as there are changes, but it saves a lot of time than manual startup. Even if it is not saved, just restarting automatically makes people worry-free.
What was said earlier exceeded expectations: it also supports remote updates and restart startups. It is pushed to the remote server by monitoring file modifications on the local path and then restarting. You can use it as long as your spring-boot project involves local resource modifications.
It can be used in the browser with the LiveReload plugin.
Special Note
If your project uses the "template engine framework", it will make you feel very happy
Such as commonly used Freemarker, Velocity, Groovy, Thymeleaf, Mustache
use
gradle build configuration
compile("org.springframework.boot:spring-boot-devtools")Just add dependencies (i.e. reference jars), no need to use "code". But there are some configurations that can be used, and are configured in application.properties.
spring.devtools.* These listed configurations are all spring-boot-devtools-related configurations.
where spring.devtools.restart.enabled indicates whether to enable automatic startup
Summarize
The above is the spring boot instant restart (hot replacement) introduced by the editor. I hope it will be helpful to everyone. If you have any questions, please leave me a message and the editor will reply to everyone in time. Thank you very much for your support to Wulin.com website!