第一步:添加依赖和开启热部署
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<version>2.4.1</version>
<scope>runtime</scope>
<optional>true</optional>
</dependency>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<fork>true</fork>
</configuration>
</plugin>
第二步:setting->build->compile
第三步:按住 shift+alt+ctrl(command)+/ ,并选择Registry
勾选住以下两个选项
修改页面不用重启
第四步:重启idea
Chrome禁用缓存
F12(或Ctrl+Shift+J或Ctrl+Shift+I)--> NetWork --> Disable Cache(while DevTools is open)