idea自動熱部署功能

解決問題:改代碼後手動重啓的煩惱。

熱部署Devtools

1.Adding devtools to your project(pom文件添加devtools依賴jar包)

<!-- https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-devtools -->
<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-devtools</artifactId>
   <scope>runtime</scope>
    <optional>true</optional>
</dependency>

 

2.Adding plugin to your pom.xml(添加插件到pom文件中)

下一段配置黏貼到父工程當中的pom裏


<build>
  <plugins>
    <plugin>
      <groupId>org.springframework.boot</groupId>
      <artifactId>spring-boot-maven-plugin</artifactId>
      <configuration>
        <fork>true</fork>
        <addResources>true</addResources>
      </configuration>
    </plugin>
  </plugins>
</build>

3.Enabling automatic build(開啓自動編譯權限) 

4.Update the value of (更新值)

快捷鍵 :ctrl+shift+alt+/  然後彈出如下圖彈框:

 

5.重啓idea,啓動工程 

6.更改工程代碼看控制檯是否自動加載重啓

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