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