(1)在Maven中添加依赖
spring-boot热部署
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
</dependency>
(2)在插件配置
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>2.2.6.RELEASE</version>
<configuration>
<fork>true</fork>
</configuration>
</plugin>
</plugins>
</build>
(3)因为idea默认是没有自动编译的,我们这里需要添加修改配置.打开设置
1、File-Settings-Compiler-Build Project automatically
2、ctrl + shift + alt + /,选择Registry,勾上 Compiler autoMake allow when app running,
打上勾点击close
3、建议重启下idea