springboot 在idea中實現熱部署(轉)

來源:互聯網
上載者:User

標籤:mave   修改   web   選擇   config   解決   14.   csdn   TE   

自己用到了iIntelliJ IDEA 這個ide工具,但是和以前的工具寫html,css,js直接重新整理頁面不同,這個需要去熱部署,網上搜的解決方案:

SpringBoot的web項目,在每一次修改了java檔案或者是resource的時候,都必須去重啟一下項目,這樣的話浪費了很多的時間,實現了熱部署,在每一次作了修改之後,都會自動的重啟 
第一步:引入熱載入的外掛程式,springboot 1.3開始就有的

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

project 中添加spring-boot-maven-plugin,主要在eclipse中起作用,idea不需要加此配置,springboot 項目的話,應該是有此配置,加裡面的內容即可。

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

第二部 : idea設定(14版本) 
1、點擊: file ,Settings ,Build ,Execution,Deplment 

 

然後記得apply,ok。 
2、按鍵組合:Shift+ALT+Ctrl+/ ,選擇“Registry”,斷行符號,找到“complier.automake.allow.when.app.running” 

注意:

因為我的idea是14版本,有的15版本或者是更高的在compiler 裡面是這樣的: 

,然後快速鍵是Ctrl + Shift +A ,一樣找到complier.automake.allow.when.app.running,點擊勾選即可。

第三部: 如果你用的瀏覽器和我的一樣,那麼就禁用緩衝 
按F12(更多工具—->開發人員工具),找到network,勾選Disable Cache。

原文地址:78771746

springboot 在idea中實現熱部署(轉)

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.