idea配置SpringBoot熱部署之自動Build


 

一、pom.xml文件導入所需依賴文件,在dependencys結點中添加:

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

 

二、pom.xml文件build標簽進行修改如下

<plugin>
                <!--熱部署配置-->
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
                <configuration>
                    <!--fork:如果沒有該項配置,整個devtools不會起作用-->
                    <fork>true</fork>
                </configuration>
            </plugin>

三、設置IDEA的自動編譯:

點擊菜單File-Settings-Compiler勾選 Build Project automatically

 

 

 四、按快捷鍵 ctrl + shift + alt + /,選擇Registry,勾上 Compiler autoMake allow when app running

 

 

 

五。重啟IDEA即可生效

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM