In the development of Spring Boot applications, if you do not want to restart the application repeatedly, you can use Spring Boot’s DevTools tool to implement the Hot Load function. This article show you how to use the Hot Load in IntelliJ IDEA.
Add Dependency
First, we need add the dependency - DevTools in Spring Boot Application.
1 | <dependency> |
The optional option is to prevent devtools dependencies from being passed to other modules. When a developer packages an app and runs it, devtools is automatically disabled
The runtime option in scope - it set the dependency(package) only works at runtime, not when packaging (prevents the execution of the packaged program online, starts the file listening thread File Watcher, consumes a lot of memory resources)
Launch the hot load feature in IntelliJ IDEA
Settings-compiler-make project automatically
ctrl+shift+alt+/ to activates the Registry dialog box (Mac OS activates the Registry dialog box by double-clicking the shift key)
In the second step of the dialog box, check compiler.automake.allow.when.app.running