SpringCloud工程熱部署

一、工程中引入依賴

在每個需要進行熱部署的微服務中引入依賴

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

在父工程的pom文件中,進行熱部署配置:

  <build>
  	<fileName>你自己的工程名字<fileName>
    <plugins>
      <plugin>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-maven-plugin</artifactId>
        <configuration>
          <fork>true</fork>
          <addResources>true</addResources>
        </configuration>
      </plugin>
    </plugins>
  </build>

二、idea工具中進行熱部署配置

在這裏插入圖片描述

三、開啓允許自動編譯功能

快捷鍵:ctrl+shift+alt+/
選擇註冊:
在這裏插入圖片描述
開啓運行時自動編譯功能:
在這裏插入圖片描述

四、重啓項目

重啓項目,熱部署成功。

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