(1) “File” -> “Settings” -> “Build,Execution,Deplyment” -> “Compiler”,选中打勾 “Build project automatically” 。
(2) 组合键:“Shift+Ctrl+Alt+/” ,选择 “Registry” ,选中打勾 “compiler.automake.allow.when.app.running”
还不行,上大招
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtool</artifactId>
<optional>true</optional>
</dependency>
配置文件
spring:
#热部署
devtools:
restart:
enabled: true #设置开启热部署
additional-paths: src/main/java #重启目录
exclude: WEB-INF/**
freemarker:
cache: false #页面不加载缓存,修改即时生效
开启IDEA自动构建与SpringBoot热部署配置
文章讲述了在IDEA中启用自动构建的步骤,包括在File-Settings-Compiler中勾选选项,以及通过Registry设置compiler.automake.allow.when.app.running。此外,还介绍了通过引入SpringBoot的devtools依赖来实现应用运行时的热部署,配置包括启用restart功能,指定额外的监视路径,并排除某些文件夹,以及禁用Freemarker的缓存以实现修改后即时生效。
4954

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



