IntelliJ IDEA热部署配置总结
Intellij IDEA 4种配置热部署的方法:
热部署可以使的修改代码后,无须重启服务器,就可以加载更改的代码。
第1种:修改服务器配置,使得IDEA窗口失去焦点时,更新类和资源
菜单Run -> EditConfiguration , 然后配置指定服务器下,右侧server标签下on frame deactivation = Update classes and resource。
优点:简单
缺点:基于JVM提供的热加载仅支持方法块内代码修改,只有debug模式下,并且是在idea失去焦点时才会出发热加载,相对加载速度缓慢
第2种:使用springloaded jar包
a. 下载jar包,github:https://github.com/spring-projects/spring-loaded
b. 启动应用时添加VM启动参数:-javaagent:/home/lkqm/.m2/repository/org/springframework/springloaded/1.2.7.RELEASE/springloaded-1.2.7.RELEASE.jar -noverify
优点:对Spring系列框架支持好(不含Spring boot), 支持 成员级别的修改(增删改方法、字段、注解),支持对枚举值集。
缺点:与优点相对
第3种:使用spring-boot-devtools提供的开发者工具
spring-boot项目中引入如下依赖
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
</dependency>
优点:简单,支持Spring-boot项目,支持成员级别的修改热部署。
缺点:只支持spring-boot项目。
第4种:使用Jrebel插件实现热部署(该插件14天免费试用)
在线安装:菜单File -> Setting -> Plugin, 点击右侧底部 Browse repositories, 弹出框顶部输入:JReble for Intellij, 选中安装即可。
优点:强大,对各类框架支持,并且提供IDE插件的方式。
/**
* 使用intelliJ idea 不会默认重新编译当前代码
*/
最后3种方法是基于类加载机制来实现热加载的,因此你修改完成代码后必须重新编译当前代码,才能触发热部署。
Eclipse默认就支持了自动编译,而在Intellij IDEA中默认是关闭了自动编译的,可以按照如下2步设置开启:
/**
*Intellij IDEA 开启自动编译
*/
1.IDEA开启项目自动编译,进入设置,Build,Execut, Deployment -> Compiler 勾选中左侧的Build Project automatically
2.IDEA开启项目运行时自动make, ctrl + shift + a搜索命令:registry -> 勾选compiler.automake.allow.when.app.running
出现问题:修改后重新加载之后,不能访问
解决方法(不知道是否正确)在Compiler中全部勾选,最好是用Debug运行项目
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
IntelliJ IDEA热部署配置总结的更多相关文章
- Tomcat7 + JRebel6.3.0 + IntelliJ idea 热部署配置过程+错误分析
以前使用Tomcat的时候直接就可以热部署,现在换了一个使用Spring框架的项目突然就不能热部署了. 网上说在tomcat里conf/context.xml中加入 <Context antiJ ...
- IntelliJ IDEA - 热部署插件JRebel ,对静态资源文件进行热部署?javascript、css、vm文件
IntelliJ IDEA - 热部署插件JRebel ,对静态资源文件进行热部署?javascript.css.vm文件https://blog.csdn.net/feng_pump/article ...
- Jrebel热部署配置完整教程(IntelliJ IDEA、Jrebel、spring boot、springboot、eclipse、Tomcat)
标签:IntelliJ IDEA.Jrebel.spring boot.springboot.eclipse.Tomcat1.安装插件并激活插件安装参考:http://blog.csdn.net/u0 ...
- IntelliJ IDEA - 热部署插件JRebel 安装使用教程
IntelliJ IDEA - JRebel 安装使用教程 JRebel 能做什么? JRebel 是一款热部署插件.当你的 Java-web 项目在 tomcat 中 run/debug 的时候 , ...
- 安装IntelliJ IDEA热部署tomcat插件JreBel
最近试着使用IntelliJ IDEA这款IDE,网上说它是最好用的java开发工具~但奈何国内ecilpse市场占有率实在稳固,所以国内这个工具也就少数人在使用 当然使用起来跟ecilpse还是有很 ...
- SpringBoot热部署配置(基于Maven)
热部署的意思是只要类中的代码被修改了,就能实时生效,而不用重启项目.spring-boot-devtools 是一个为开发者服务的一个模块,其中最重要的功能就是自动应用代码更改到最新的App上面去.原 ...
- Intellij IDEA 热部署处理
1. 首先参考IDEA热部署同行经验分享: Intellij IDEA 4种配置热部署的方法 2. IDEA 热部署实战: springboot项目: 不要引入热部署工具包spring-boot- ...
- 记录Tomcat7.x热部署配置过程
我自己的开发版本是tomcat7.0.43+myeclipse14 原版在:http://blog.csdn.NET/chen_zw/article/details/8867779 热部署是指在你对项 ...
- apache-maven-3.3.9集成apache-tomcat-7.0.72实现热部署配置细节
1.开发环境.Maven.Tomcat安装不作描述,搜索引擎很多文章可供参考. 2.Tomcat配置文件修改 1)Tomcat管理权限配置 1.1)在tomcat安装目录下找到tomcat-users ...
随机推荐
- u-boot 移植 --->2、在u-boot新增SOC和板子
本次主要是要新增一个samsung的芯片到u-boot中,网上查阅资料发现s5pc1xx是与手上的S5PV210的友善的Tiny版子寄存器兼容的比较多,所以就准备以他为基础增加一个我的板子的支持到u- ...
- postman skills
postman skills variables https://learning.postman.com/docs/sending-requests/variables/ https://learn ...
- React Query & SWR
React Query & SWR HTTP request all in one solution React Query Hooks for fetching, caching and u ...
- node --experimental-modules & node.js ES Modules
node --experimental-modules & node.js ES Modules how to run esm modules in node.js cli $ node -v ...
- Array.fill & array padding
Array.fill & array padding arr.fill(value[, start[, end]]) https://developer.mozilla.org/en-US/d ...
- ES Next & Arrow function & Promise & Iterator & Generator yield & Async Await
ES Next & Arrow function & Promise & Iterator & Generator yield & Async Await co ...
- SVG & Blob & Base64
SVG & Blob https://developer.mozilla.org/en-US/docs/Web/API/Blob SVG & Base64 https://develo ...
- Nestjs 验证对象数组
route @Patch(':id') patch(@Param('id') id: string, @Body() removeEssayDto: RemoveEssayDto) { return ...
- Masterboxan INC 下半年将聚焦超高净值和家族全权委托客户
"投资是一个没有终点的奋斗.我们不能简单的预测市场,而是应对市场做出正确的反应.这需要我们不断反思.总结.提升,找到自己的投资哲学,然后用一生的时间去坚守."Masterboxan ...
- 翻译:《实用的Python编程》02_04_Sequences
目录| 上一节 (2.3 格式化) | 下一节 (2.5 Collections模块) 2.4 序列 序列数据类型 Python 有三种序列数据类型. 字符串:如 'Hello'.字符串是字符序列 列 ...