SpringBoot 热部署
1.第一步:关于模板引擎
在 Spring Boot 开发环境下禁用模板缓存
#开发环境下关闭 thymeleaf 模板缓存,thymeleaf 默认是开启状态
spring.thymeleaf.cache=false
2.第二部
添加热部署依赖
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
</dependency>
3.第三步:Intellij IEDA和 Eclipse 不同,Intellij IDEA必须做一些小调整
在 Eclipse 中,修改文件后要手动进行保存,它就会自动编译,就触发热部署现象,而在 Intellij IEDA 中,
修改文件后都是自动保存,默认不会自动编译文件,需要手动编译按 Ctrl + F9 (推荐使用)或 Build ->
Build Project ;或者进行以下设置才会自动编译(效果不明显) 。
(File -> Settings -> Build, Execution, Deployment -> Compiler -> 勾选 Build project automatically)