问题:当我们修改代码后,频繁的启动服务的时,会浪费我们大量的时间
解决方案:springboot 热部署 (暂不支持cloud框架,自动重启时,单例模式会冲突,暂没找到解决方案, 欢迎大神留言)
修改代码后,刷新页面,自动将修改后的代码结果返回到前端
前提:Idea 才支持该热部署, STS和eclipse 目前没测试过
1.引入依赖
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
</dependency>
2.修改idea配置
3.ctrl+alt+shift+/ --- registry --- compiler.automake.allow.when.app.running √
重启项目---修改代码---刷新页面---搞定
转载请注明:来源