idea靈活使用 Spring boot 熱部署配置

idea靈活使用 Spring boot 熱部署配置

1、引入jar包

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

2、idea 配置修改

  1. 組合鍵:“Shift+Ctrl+Alt+/” ,選擇 “Registry” ,選中打勾“compiler.automake.allow.when.app.running” 在這裏插入圖片描述

  2. “File” -> “Settings” -> “Build,Execution,Deplyment” -> “Compiler”,選中打勾 “Build project automatically” 。在這裏插入圖片描述

  3. 在這裏插入圖片描述 在這裏插入圖片描述

3、配置application.yml

devtools:
    restart:
      enabled: false    ## true時修改class文件自動重啓服務
      exclude: congig/**,templates/**,static/**   ## 靜態文件修改刷新頁面生效
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章