在IDEA上对SpringBoot进行热部署的方法

在我们平时的开发中,修改类或者一些静态资源(如html),需要我们重新启动一下才能生效,为了更方便,作如下配置,便可以不重启进行内容的更新:

一.在pom.xml中的<dependencies> </dependencies>标签内添加如下配置:

<dependency>

            <groupId>org.springframework.boot</groupId>

            <artifactId>spring-boot-devtools</artifactId>

            <optional>true</optional>

</dependency>

二.点击IDEA的File-Settings

然后找到Compiler,勾选上Build project automatically,然后点OK退出

三.按Shift+Ctrl+Alt+/,弹出小框,选择Registry

然后找到compiler.automake.allow.when.app.running并勾上,然后点close退出

 

完成以上步骤后便完成了热部署。

posted @ 2020-10-28 11:12  咖啡&牛奶  阅读(403)  评论(0编辑  收藏  举报