- 在pom.xml文件中的添加如下依赖和配置。
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
</dependency>

2.如果项目中引入了引擎模板,注意要关闭其缓存。我的项目中引入的是thymeleaf模板,在application.properties文件中加入
spring.thymeleaf.cache=false
3.点击 File—->Settings—->Compiler—->勾选Build project automatically

4.ctrl+shift+a 搜索Registry,勾选compiler.automake.allow.when.app.running就OK了。


本文介绍如何通过简单几步实现Spring Boot项目的热部署:添加spring-boot-devtools依赖、禁用Thymeleaf模板缓存、设置IDE自动编译及运行选项。
1024

被折叠的 条评论
为什么被折叠?



