IDEA配置JRebel實現熱部署


IDEA配置JRebel實現熱部署

1.下載JRebel and XRebel for Intellij插件

在這里插入圖片描述

2. 激活

在這里插入圖片描述
請查看這個文章http://www.cicoding.cn/other/jrebel-activation/
激活后
開始配置自動編譯
在這里插入圖片描述

3.勾選Build project automatically

ctrl + shift + alt + / ,選擇Registry,勾上 Compiler autoMake allow when app running
在這里插入圖片描述

4.Edit Configurations

在這里插入圖片描述

on update action和 on frame deactivation改成 update classes and resources

在這里插入圖片描述

5.打開JRebel tool

在這里插入圖片描述

6.勾選你要熱部署的應用

在這里插入圖片描述

查看JRebel日志

在這里插入圖片描述

使用JRebel啟動springboot項目
在這里插入圖片描述

查看控制台日志

在這里插入圖片描述

常見錯誤

jrebel.jar不兼容

在這里插入圖片描述
JRebel-JVMTI [ERROR] You're using an incompatible 'jrebel.jar' with the JRebel Agent.
JRebel-JVMTI [FATAL] Please make sure that'C:\Users\XXX\AppData\Roaming\JetBrains\IntelliJIdea2020.2\plugins\jr-ide-idea\lib\jrebel6\jrebel.jar' is a copy of lib JRebel ZIP release \Jrebel.jar.

這可能是因為你的IDEA可能不是最新版本,但jrebel的jar包為最新版導致的,

因此請轉到官方網站下載你指定IDEA版本的JRebel壓縮包。然后解壓縮壓縮包以找到jrebel.jar,並將jrebel使用的jar包的路徑更改為解壓縮后的jrebel.jar的文件路徑。
在這里插入圖片描述
再次使用JRebel啟動SpringBoot項目並成功啟動。如果修改代碼,將鼠標點向IDEA窗口以外的區域會自動build(或者手動按ctrl+shfit+F9)
在這里插入圖片描述
在這里插入圖片描述
MrBird nb


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM