天天看點

IDEA中配置熱部署

一、在pom.xml檔案中添加依賴

<!-- 熱部署 -->
<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-devtools</artifactId>
    <optional>true</optional> <!-- 這個需要為 true 熱部署才有效 -->
</dependency>
           

二、IDEA開啟項目自動編譯

IDEA左上角–>file–>Settings,找到Build,Execution,DepLoyment–>Compiler,并勾選Build project automatically。

IDEA中配置熱部署

三、IDEA開啟項目運作時自動make

通過

ctrl+shift+alt+/

快捷鍵進入Maintenance,進入registry,勾選compiler.automake.allow.when.app.running

IDEA中配置熱部署

四、重新開機IDEA,完成

五、如果不能用,可以同時關閉浏覽器緩存

IDEA中配置熱部署

繼續閱讀