1 添加maven依賴
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<scope>runtime</scope>
<optional>true</optional>
</dependency>
2 idea配置

ctrl + alt + s 設(shè)置界面,Build-Compiler 界面 勾選automatically

CTRL + SHIFT + A –>輸入并進入Registry–>勾選 compiler.automake.allow.when.app.running

image.png