首先在pom.xml中添加devtools依赖html
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<optional>true</optional>
</dependency>
由于IDEA修改代码不会自动编译,因此咱们须要修改:spring
1) “File” -> “Settings” -> “Build,Execution,Deplyment” -> “Compiler”,选中打勾 “Build project automatically” 缓存
2) 组合键:“Shift+Ctrl+Alt+/” ,选择 “Registry” ,选中打勾 “compiler.automake.allow.when.app.running” app
禁用Chrome缓存:spring-boot
F12或者“Ctrl+Shift+I”,打开开发者工具,“Network” 选项卡下 选中打勾 “Disable Cache(while DevTools is open)” 工具
参考连接:https://www.cnblogs.com/sprinkle/p/7058630.htmlui