IDEA中Spring boot项目调试修改内容立即生效,需要修改配置
一、修改idea配置
File” -> “Settings” -> “Build,Execution,Deplyment” -> “Compiler”,选中打勾 “Build project automatically” 。
注意:这个设置不是全局的,导入新的项目还需要勾选这里
配置二、组合键:“Shift+Ctrl+Alt+/” ,选择 “Registry” ,选中打勾 “compiler.automake.allow.when.app.running”
三、application.properties文件中关闭缓存
spring.thymeleaf.cache=false
四、添加依赖
<!-- 修改后立即生效,热部署 -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>springloaded</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
</dependency>