首頁 > Java > Java基礎 > 主體

詳解 Spring Boot 熱部署 Devtools

Guanhui
發布: 2020-07-24 17:19:33
轉載
2326 人瀏覽過

詳解 Spring Boot 熱部署 Devtools

1 pom.xml檔案

#註:熱部署功能spring-boot-1.3開始有的

<!--添加依赖-->
<dependency>
  <groupId>org.springframework.boot</groupId>
  <artifactId>spring-boot-devtools</artifactId>
  <!-- optional=true,依赖不会传递,该项目依赖devtools;之后依赖myboot项目的项目如果想要使用devtools,需要重新引入 -->
  <optional>true</optional>
</dependency>
登入後複製

附註:project 中新增spring-boot-maven-plugin,主要在eclipse中使用,idea中不需要新增此配置。


<build>
  <plugins>
    <plugin>
      <groupId>org.springframework.boot</groupId>
      <artifactId>spring-boot-maven-plugin</artifactId>
      <configuration>
        <fork>true</fork>
      </configuration>
    </plugin>
  </plugins>
</build>
登入後複製

2 更改idea配置

  1) “File” -> “Settings” -> “ Build,Execution,Deplyment” -> “Compiler”,選取勾選“Build project automatically” 。

  2) 組合鍵:「Shift Ctrl Alt /」 ,選擇 “Registry” ,選取打勾 “compiler.automake.allow.when.app.running” 。

3 Chrome停用快取

  F12或「Ctrl Shift I」,開啟開發者工具,「Network」 標籤下選取勾選「Disable Cache(while DevTools is open)」

推薦教學:《Java教學

以上是詳解 Spring Boot 熱部署 Devtools的詳細內容。更多資訊請關注PHP中文網其他相關文章!

相關標籤:
來源:jb51.net
本網站聲明
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn
熱門教學
更多>
最新下載
更多>
網站特效
網站源碼
網站素材
前端模板
關於我們 免責聲明 Sitemap
PHP中文網:公益線上PHP培訓,幫助PHP學習者快速成長!