引入了devtools
依賴,目的是能夠在配置、代碼更新時,能夠熱啟動項目,不用每次都手動停止,再啟動,不過在Idea
中需要進行如下兩步,完成配置:
Ctrl+Shift+Alt+/
打開maintenance
面板,選擇第一個registry
, 勾選compiler.automake.allow.when.app.running
保存;Ctrl+Alt+S
, 打開配置面板,在File | Settings | Build, Execution, Deployment | Compiler下勾選Build project automatically
;
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<scope>runtime</scope>
<optional>true</optional>
</dependency>