1.添加 devtools依赖

<!--热部署依赖,生产环境、应用被打成jar包后,自动失效-->
<dependency>
   <groupId>org.springframework.boot</groupId>
   <artifactId>spring-boot-devtools</artifactId>
   <optional>true</optional>
</dependency>

2.idea下启动项目自动构建

idea 设置项目热部署

3. idea中compiler.automake.allow.when.app.running 属性更改为true  

 mac的快捷键为  shirt + option+cpmmond+/   找到registry  点击进去 找到 compiler.automake.allow.when.app.running 选项 选中它、确定   OK

 

 

 

相关文章: