Loading

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

 

此时改动代码后,会自动重启项目!!

 

posted @ 2020-08-14 22:27  青岑  阅读(2570)  评论(0)    收藏  举报