1.添加依赖
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<optional>true</optional>
</dependency>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<fork>true</fork><!-- 设置为true-->
</configuration>
</plugin>
2.ctrl + shift + A --> 查找Registry,找到compiler.automake.allow.when.app.running,打钩
3.最后
完成
--------另附源码-----------
https://github.com/email95/SpringBootHotswap.git
本文介绍了在IDEA中使用SpringBoot进行热部署的步骤,包括添加spring-boot-devtools依赖,配置spring-boot-maven-plugin插件,以及启用IDEA的compiler.automake.allow.when.app.running选项,实现代码修改后自动更新。
3871

被折叠的 条评论
为什么被折叠?



