1.添加依賴
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<optional>true</optional> 不能被其它模塊繼承,如果多個子模塊可以去掉 不必須
<scope>runtime</scope> 只在運行時起作用 打包時不打進去
</dependency>
2.要重新編譯項目
重啟服務器
idea:
設置File ->Setting ->Compile: 勾選“Build project automatically”選項
