加载中...
加载中...
IDEA中Spring boot项目调试修改内容立即生效(热部署)

IDEA中Spring boot项目调试修改内容立即生效(热部署) 原创

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>
没有更多推荐了 [去首页]
image
文章
376
原创
293
转载
83
翻译
0
访问量
183411
喜欢
73
粉丝
5
码龄
7年
资源
3

文章目录

加载中...
0
0