mac/windows 下springboot配置idea 热部署

背景:

在开发中,当我们修改代码之后,每次都要重新启动,很是浪费时间,在springboot中就有一种热部署方式,可以实现想要修改不需要每次都重新启动,保存即可生效

用法:

一、maven 添加

mac/windows 下springboot配置idea 热部署

二、添加编译时候的配置

如下的配置在idea的springBoot项目中可以不需要添加,因为springBoot项目中已经默认有了此配置(亲测没有这个也可以)

mac/windows 下springboot配置idea 热部署

三、idea 配置自动编译

1.配置

preference->Build,Execution,Deployment->Compiler  打开里面的: Build project automatically 

mac/windows 下springboot配置idea 热部署

2.注册表的修改

windows环境下:ctrl+shift+alt+/

mac环境下:cmd+shift+a 

mac/windows 下springboot配置idea 热部署

mac/windows 下springboot配置idea 热部署

选择后即可热部署了

注意:

如果项目中已经有cglib或者javassist生成的类,这里可能会有点问题