一.首先添加org.springframework.boot:spring-boot-devtools 依赖项

<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-devtools</artifactId>
    <scope>true</scope>
    <optional>true</optional>
</dependency>

二.idea配置,编辑器配置勾选 make project automatically

三.idea中compiler.automake.allow.when.app.running 属性更改为true
windows环境:按快捷键Ctrl+Shift+Alt+/,选择1.Registry
mac: 组合键 shift + option + command + / 选择1.Registry(这个组合键真不好找。。。)
然后 找到 compiler.automake.allow.when.app.running 选项勾选

四.成功完成热部署