Intellij IDEA中SpringBoot 项目,自动编译,热部署,立刻看到效果
1:在pom.xml 中 配置
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<optional>true</optional>
</dependency>
注意:并不是pom.xml 的<build>标签中
2: 如果有页面的话 禁止页面缓存
spring:
application:
name: XXX
aop:
proxy-target-class: true
thymeleaf:
cache: false
prefix: classpath:/templates/
mode: LEGACYHTML5
3:开idea工具的自动编译功能
完成以上步骤 即可实现SpringBoot项目自动编译+热部署,这我们修改后的代码能够立刻看到效果,提高效率!