只要在pom文件中添加下面代码段即可
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<optional>true</optional>
<scope>true</scope>
</dependency>
org.springframework.boot spring-boot-maven-plugin true true
但是配置好无效,下面需要修改idea中的两个配置
setting –> compiler
将 Build project automatically 勾选上
alt + shift + a 搜索 registry 选第一个,弹出框后下拉找到 compiler.automake.allow.when.app.running 勾选上即可。
热部署无效问题已解决。
详细网址
https://blog.csdn.net/android_ztz/article/details/79221753