Springboot项目整合devtools,实现热部署(idea)
1.pom.xml引入依赖
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
</dependency>
2.修改idea设置
“File” -> “Settings” -> “Build,Execution,Deplyment” -> “Compiler”,打勾 “Build project automatically”
快捷键:“Shift+Ctrl+Alt+/” ,选择 “Registry” ,选中打勾 “compiler.automake.allow.when.app.running”
修改启动类相关配置
3.修改浏览器相关配置(谷歌)
F12或者“Ctrl+Shift+I”,打开开发者工具,“Network” 选项卡下 选中打勾 “Disable Cache”
4.开始测试
修改Java代码之后:
查看相关日志信息:
总结
每天一个提升小技巧!!!