开启idea环境中Springboot热部署,需要以下步骤:
第一步:引入spring-boot-devtools。在pom中加入以下代码
<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-devtools</artifactId> <scope>runtime</scope> <optional>true</optional> </dependency>
加入以下插件,项目可以通过手动编译后,自动启动。
第二步:开启idea自动编译模式。idea默认没有开启自动编译。具体过程如下。
- 进入设置setting,Build,Execut, Deployment -> Compiler 勾选右侧的Build Project automatically
- 开启项目运行时自动build。
1、ctrl + shift + a 搜索命令,搜索命令:registry
2、勾选compiler.automake.allow.when.app.running