idea hot deployment-modify code without restarting

I recently discovered that many of the guys in the team don’t know that modifications to Java code will take effect without restarting.

After learning about it, I realized that everyone said that the idea is not good and requires the installation of plug-ins;

But I have been using it normally for how long I have been developing it! When debugging is started: As long as the method name is not modified, modifying the code in the method body in Java will take effect immediately.

I can do it locally, so I helped to deal with it. Unexpectedly, I tried Baidu and csdn, but it didn't work.

I thought it was an issue with the idea version and left it alone. Finally, another guy found the problem and I confirmed it. I need to configure this:

Settings>HotSwap:Reload classes after compilation: Select Always and save.

 [Important]: The first request for the interface will not take effect, and the modification will not take effect. It will only take effect after the second request for the interface;

My local idea 2019.3.4 version can be updated even if Build project automatically is not checked;

If not, just refer to this normal configuration:

1. Turn on IDEA’s automatic compilation (static)

Specific steps: Open the top toolbar File -> Settings -> Default Settings -> Build -> Compiler and then check Build project automatically.

2. Turn on IDEA’s automatic compilation (dynamic)

Specific steps: Hold down Ctrl + Shift + Alt + / at the same time and then enter the Registry, check automatic compilation and adjust the delay parameters.

  • compiler.automake.allow.when.app.running -> Automatic compilation
  • compile.document.save.trigger.delay -> Automatically update files

PS: Very few people on the Internet have mentioned compile.document.save.trigger.delay. It is mainly for updating static files such as JS CSS. After reducing the delay time, just press F5 to refresh the page and you will see the effect!

idea enables hot deploymenthttps://blog.csdn.net/weixin_46054799/article/details/109734768?ops_request_misc=&request_id=&biz_id=102&utm_term= idea%20%E7%83%AD%E9%83%A8%E7%BD%B2&utm_medium=distribute.pc_search_result.none-task-blog-2~all~sobaiduweb~default-2-109734768.142%5Ev56%5Eopensearch_v2, 201%5Ev3%5Econtrol_2&spm=1018.2226.3001.4187Configure the first and second ones.

Guess you like

Origin blog.csdn.net/hezhenfei8/article/details/127372941