SpringBoot開發模式自動重啓spring-boot-devtools

1、添加依賴

<dependency>
     <groupId>org.springframework.boot</groupId>
     <artifactId>spring-boot-devtools</artifactId>
     <optional>true</optional>
 </dependency>

2、修改配置application.yml

spring:
  devtools:
    restart:
      enabled: true

3、將項目設置爲自動加載

1、打開設置 勾選 Build project automatically
在這裏插入圖片描述
2、打開 Maintenance 選擇 1.Register

快捷鍵 (一起按下四個按鍵)

windows: Ctrl + Shift +Alt + /

Mac : command + shift + option + /
在這裏插入圖片描述
3、勾選 compiler.automake.allow.when.app.running
在這裏插入圖片描述

參考
SpringBoot熱部署自動重啓 spring-boot-devtools

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