1.引入jar
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
</dependency>
<!--热部署-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
</dependency>
2.配置文件
spring:
profiles: development
devtools:
restart:
additional-paths: src/main
enabled: true
thymeleaf:
cache: false
cache-period: 0
template:
cache: false
resources:
chain:
cache: false
output:
ansi:
enabled: always
3.触发热部署
1. 1. 快捷键触发
ctrl+s和ctrl+f 触发热部署
2. 2. 编辑宏(idea支持宏,)
说明: ctrl+s 触发宏,宏执行的是ctrl+s和ctrl+f9,懒人必备,勇敢去尝试吧。
宏的具体编辑,参考https://my.oschina.net/fdblog/blog/172229