Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use JRebel plug-in to realize hot loading of SpringBoot application code

2025-01-30 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/03 Report--

How to use the JRebel plug-in to achieve SpringBoot application code hot loading, I believe that many inexperienced people do not know what to do, so this paper summarizes the causes of the problem and solutions, through this article I hope you can solve this problem.

Preface

In the actual development process, we often restart the project manually after modifying the code to see the effect of the changes. So is there a way to help us update the modified code automatically and avoid manual restart, so as to improve the efficiency of development? Yes, in my previous article, I introduced readers to the method of using springboot-devtools to achieve hot loading. This article will introduce you to another way: use the Jrebel plug-in to modify the code and automatically update resources.

But for this function, many people dispute the name of the function. I have consulted Wikipedia and official documents, and there is no reasonable answer and no authoritative definition. What I know are: hot start, hot load, hot update, hot deployment, hot swap. These words are different in semantics, but what they are called is not important, and the realization is the most important. after all, most programmers do not engage in academic research in order to use this function to facilitate development. If any student has obtained the opinion of the authoritative channel, you can give me the document link back. I understand it again and strive to achieve the meticulous level of academic research! Before that, the author uses these nouns according to his own ideas and the perspective of English translation.

Using the Jrebel plug-in to achieve hot loading is the easiest way, but there are some limitations. The Jrebel plug-in is free. Although there is a cracking plan, it is not recommended! Students in need do their own research, so I won't make any more introductions here. (if you really need it, you can refer to my blog address at the end of the article)

Step 1: install the plug-in

IntelliJ IDEA is the most frequently used IDE by the author. This article gives an example of the installation and use of Jrebel in IDEA. Select the installation as shown in the arrow. After the installation is complete, you need to restart IDEA to take effect.

Step 2: activate the plug-in

After the installation is complete, there will be several more buttons in the upper right corner. After clicking, you will be prompted to activate the plug-in, either by purchasing a registration code or online. You can also fill in your name, email address and phone number to get a 10-day probation period!

Step 3: update operation triggers configuration

This configuration is not only effective in combination with Jrebel, but also suitable for other ways to achieve hot loading, automatic code and resource updates.

In the Spring Boot project startup configuration, select the contents in the red box in the following figure: uodate classes and resources on 'update' action

After the configuration is complete, start the SpringBoot project through the JR button in the upper right corner. You can change the code and automatically update resources.

Finally, I'd like to make it clear that although this approach is simple, the Jrebel plug-in is a paid plug-in.

After reading the above, have you mastered how to use the JRebel plug-in to achieve the hot loading of SpringBoot application code? If you want to learn more skills or want to know more about it, you are welcome to follow the industry information channel, thank you for reading!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report