Spring boot instant restart (hot replacement) instructions for use, springboot
Requirement
During spring-boot project development, the project starts very slowly. How painful it is to restart the project every time you modify the code or static resource file. How can I "restart" the project when it is changed again?
Lead
Spring-boot-devtools the spring module can solve this requirement, or even exceed the expected functions. The biggest feature is that the project will be "restarted immediately" as long as there are changes, but it saves a lot of time than manual start. Even if there is no savings, it is easy to simply restart the feature automatically.
As mentioned above, remote update and restart are also supported. It is pushed to the remote server by monitoring local path file modifications, and then restarted. You can use it for any modifications to local resources in your spring-boot project.
The LiveReload plug-in can be used in a browser.
Note
If your project uses the "template engine framework", using it will make you feel bad.
Such as frequently used Freemarker, Velocity, Groovy, Thymeleaf, Mustache
Use
Gradle build configuration
compile(“org.springframework.boot:spring-boot-devtools”)
You only need to add dependencies (that is, reference jar) without using "code ". However, some configurations can be used and configured in application. properties.
Spring. devtools. * These listed configurations are all related to spring-boot-devtools.
Spring. devtools. restart. enabled indicates whether automatic start is enabled.
Summary
The above is a small series of spring boot instant restart (hot replacement), I hope to help you, if you have any questions, please leave a message, the editor will reply to you in a timely manner. Thank you very much for your support for the help House website!