Last weekend, , Help Yang Xiaoxie ( My college roommate ) Remote debugging project .SpringBoot structure , No hot deployment , If you change it, you have to restart the relevant modules . Little bug , It took me more than an hour , Most of the time it's still building ( Special , I'll have to charge next time ). I told him there was a hot deployment plug-in called Jrebel, Can be hot deployed , Every time you need to test after modifying the code , as long as Build Just a moment ? all Java Projects can use , He didn't know . As a handsome boy , I had to write this article to teach him how to use hot deployment .

Jrebel What is it? ?

JRebel Is a JAVA Virtual machine plug-ins , It makes the JAVA Programmers can do this without redeploying , See the impact of code changes on an application in real time .JRebel Enables you to see the code separately in real time 、 Changes in classes and resources , You can upload them one by one instead of deploying them all at once . When a programmer makes changes to any class or resource in the development environment , This change will be directly reflected in the deployed application , This skips the process of building and deploying .

In short , Whether you modify a class or a resource , Just... Again Build Let's look at the related classes , The changes are directly reflected in your application .

Jrebel install

Open your IntelliJ IDEA Plug in market , Search for Jrebel , The first one is . Click on install install , After that, restart IDEA.

Jrebel Activate

After restart, the following box will pop up to prompt activation , Choose Team Url , Just fill in the mailbox , The format of the authentication service address is https://jrebel.qekang.com/{GUID} It needs a guid Parameters , This parameter needs to be derived from guid Server generation . Its address is https://www.guidgen.com/, Open it directly to generate a guid ( Don't use this , It may fail ), Here's the picture :

Copy guid Fill in after the authentication service address . such as :https://jrebel.qekang.com/7bea5149-69a5-4270-8190-3f049dc8d2d6, Fill in the authentication service address bar below .

Click on change license , Activation successful .

Jrebel Use

Click on IDEA On the left side of the sidebar Jrebel Options , Configure modules that need to be hot deployed , Here's the picture , Just tick it .

When everything is ready , You will find that there are more icons in the toolbar, as shown in the figure below : One is Jrebel run Mode start project , One is Jrebel debug mode ( Some modules that need to be tested , This pattern is generally used ), Now debug mode xxxx_collect modular .

Successful launch . If , I'm not satisfied with the effect of the app right now , I have also modified the one just checked xxxx_collect The name under the module is xxxxFeignClientApi Of java class , As shown in the figure below :

There is no need to restart , Just... Again build Just look at the related classes , If there are too many changes , direct build Module is OK .

That's all Jrebel The use of the tutorial , Convenient for thieves .Jrebel You can save deployment time as much as 5.25 A few weeks (Jrebel The official said ).