依赖 spring-boot-devtools 热部署模块,在pom.xml添加
<!-- 热部署模块 -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<optional>true</optional> <!-- 这个需要为 true 热部署才有效 -->
</dependency>
一般情况下加了依赖→修改了代码→点击idea菜单栏Build→Build Moudele xxx就可以自动重启程序
如果点击后 修改的代码没效果 那就只能手动重启程序run xxx (这种情况偶尔出现)