1.在pom文件中添加依赖:
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<optional>true</optional>
</dependency>
2.在Intellij IEDA开发工具,左上角找到【File】——>【Settings…】——>【Build,Execution,Deployment】——>【Compiler】
勾选"Build project automatically",然后右下角【Apply】——【OK】:
3.使用 Ctrl+Shift+A 快捷键搜索"Registry",选择搜索出来的第一个:
4.找到"compiler.automake.allow.when.app.running",勾选,【Close】关闭:
5.重启项目:
参考链接:
SpringBoot通过配置devtools实现热部署:https://jingyan.baidu.com/article/870c6fc367b4d7b03fe4beba.html