idea如何給maven項目開啟熱部署


1)加入maven 依賴

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

 

2)將 maven-plugin 添加到父工程的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)setting->build->compile 中,將紅框中的內容勾上

clipboard

4)按住 shift+alt+ctrl+/ ,並選擇Registry

clipboard

5)勾選如下內容

clipboard

 

此時改動代碼后,會自動重啟項目!!

 


免責聲明!

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



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