idea配置热部署

第一步:添加依赖
使用spring-boot-devtools提供的开发者工具
spring-boot项目中引入如下依赖

<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
</dependency>
该方法基于类加载机制来实现热加载的,因此你修改完成代码后必须重新编译当前代码,才能触发热部署,Eclipse默认就支持了自动编译,而在Intellij IDEA中默认是关闭了自动编译的,可以按照如下2步设置开启:
IDEA开启项目自动编译,进入设置,Build,Execut, Deployment -> Compiler 勾选中左侧的Build Project automatically
IDEA开启项目运行时自动make, ctrl + shift + a搜索命令:registry -> 勾选compiler.automake.allow.when.app.running
基于类加载机制来实现热加载的,因此你修改完成代码后必须重新编译当前代码,才能触发热部署,Eclipse默认就支持了自动编译,而在Intellij IDEA中默认是关闭了自动编译的,可以按照如下2步设置开启:
1、IDEA开启项目自动编译,进入设置(ctrl+alt+s)—Build,Execution,Deployment> Compiler 勾选中左侧的Build Project automatically。

 

2、IDEA开启项目运行时自动make, ctrl + shift + alt+/ 命令:registry -> 勾选。

compiler.automake.allow.when.app.running
优点:简单,支持Spring-boot项目,支持成员级别的修改热部署。
缺点:只支持spring-boot项目。

参考博客:https://www.cnblogs.com/jcook/p/6910238.html

 

posted @ 2019-01-18 17:58  明天,你好啊  阅读(14690)  评论(0编辑  收藏  举报