4、在IntelliJ idea 中基於spring-boot-devtools 實現項目熱啓動

1、引入spring-boot-devtools maven依賴

2、開啓idea自動build功能 

3、組合鍵:Shift+ALT+Ctrl+/ ,選擇“Registry”,回車,找到“complier.automake.allow.when.app.running”

4、 設置maven plugin屬性 <fork>true</fork> <!-- fork is enable,用於明確表示編譯版本配置的可用 -->


<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<!--fork : 如果沒有該項配置,devtools不會起作用,即應用不會restart -->
<fork>true</fork>
</configuration>
</plugin>

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章