1.在pom.xml中导入依赖
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<optional>true</optional>
</dependency>
2.点击file
3.点击setting
4.点击Advanced Setting 勾选如图选项![](https://img-blog.csdnimg.cn/direct/827935cb09424941b1fb0d2df81bb6bf.png)
5.点击Build,Execution,Deployment 选择Compiler 勾选选项如图所示![](https://img-blog.csdnimg.cn/direct/fe224baf13224b6e94fc33be9c7d369a.png)
6.配置启动设置![](https://img-blog.csdnimg.cn/direct/c2e84d5f04dc46d4bd54e6b23102fde1.png)
7.配置 application.yaml
devtools:
restart:
enabled: true #设置开启热部署
additional-paths: src/main/java/com/example/demo3 #重启目录
exclude: WEB-INF/**
thymeleaf:
cache: false #使用Thymeleaf模板引擎,关闭缓存
8.配置完成 检验是否成功
热部署前
热部署后