Although springboot provides spring-boot-devtools dependencies to implement hot deployment, it is still different under different IDE tools. Take I used IDEA (the latest version) as an example, the configuration is as follows:
Step 1: In the springboot project, add to the maven dependency:
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
</dependency>
Step 2: Modify the compilation configuration of IDEA so that IDEA automatically compiles the code. The configuration is as follows:
Step 3: Tell IDEA that the running project should be compiled automatically. The configuration steps are as follows: Press the shortcut key Cmd+Shift+A (use ctrl+shift+a under Windows), pop up the search bar, enter registry, select [Registry...] in the search results and press Enter (you can also double-click the mouse ), a dialog box pops up as follows:
In this dialog, find
compiler.automake.allow.when.app.running
This item is selected (that is, the checkbox is checked), after setting, press the close button to close the dialog box.
Step 4: Restart IDEA.
The setting is now complete.