add dependencies
<dependencies>
<!-- 方便调试依赖 -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<scope>runtime</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<fork>true</fork>
</configuration>
</plugin>
</plugins>
</build>
Modify IDE configuration parameters
Mac shortcut key: shift+alt+command+/, select Registry
Window shortcut: Shift+Ctrl+Alt+/, select Registry
The test is successful, but when it's time to restart the code, it's very slow and not easy to use, you won't be able to stand it.