首页 > 其他 > 详细

idea配置热部署

时间:2019-01-18 19:18:50      阅读:184      评论:0      收藏:0      [点我收藏+]

第一步:添加依赖
使用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

 

idea配置热部署

原文:https://www.cnblogs.com/ming-blogs/p/10289075.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!