IDEA开启热部署
2022-09-22 22:43:57
热部署的作用:不需要完全重启项目就能使新编辑的代码生效。
第一步: 设置IDEA开启项目自动编译
第二步: 开启项目运行时自动生成
ctrl + shift + a(windows系统),command+shift+alt+/(mac系统)
搜索命令:registry
然后勾选 compiler.automake.allow.when.app.running
第三步:引入pom依赖
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<optional>true</optional> <!-- 这个需要为 true 热部署才有效 -->
<scope>runtime</scope>
</dependency>
最后,需要重启IDEA,才能生效