IDEA springboot 项目静态文件修改不更新的问题
springboot 项目的页面和静态文件,在项目启动后,修改无效。按照下面的配置可以解决问题。
1.file-setting
勾选项目自动构建
2.使用快捷键 ctrl+ shift+ alt + /
勾选复选框后重启,就可以了。
一、spring-boot-devtools
在pom中直接引入依赖
<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-devtools</artifactId> <optional>true</optional> </dependency>
设置以下两项(第一项如已设置直接设置第二项)
1) “File” -> “Settings” -> “Build,Execution,Deplyment” -> “Compiler”,选中打勾 “Build project automatically” 。
2) 组合键:“Shift+Ctrl+Alt+/” ,选择 “Registry” ,选中打勾 “compiler.automake.allow.when.app.running”