IDEAホットデプロイメント構成HotSwapAgent-IntelliJ-IDEA-plugin

HotSwapAgent-IntelliJ-IDEA-プラグイン

hotswaplogo

・ホットスワップ・

私たちの仕事は楽しいですが、最新の変更がアプリケーションサーバーにデプロイされるのを待つ時間を無駄にしたくありません!

Command+Shift+F9IntelliJ IDEAのHotSwapメカニズムを使用して、アプリケーション全体を再起動することなく、デバッグ中に変更されたクラスをリロードできます

jvm_hotswap_ok

BUT!現時点では、Java SDKの元の制限によりHot、メソッド本体が変更された場合にのみスワッピングが可能です。

他のすべての場合(メソッドやクラスシグネチャの変更など)では、クラスのリロードが行わimpossibleれ、対応するエラーメッセージが表示されます。

jvm_hotswap_fail

解決

変更されたクラスをリロードする機能を強化するには、JVMと一緒に特別なJavaエージェントを使用する必要があります。例えば:

  1. JRebel(高すぎる$550:恐ろしい:ユーザーあたり年間)
  2. スプリング式(java 8およびcrash JVM:dizzy_face:では正しく機能しません。Springチームは「ファイル変更時にアプリケーションを再起動する」を伝播します-Spring Bootのspring-boot-devtoolsのアプローチ
  3. FakeReplaceJDK10 +はまだサポートされていません
  4. RelProxy (デッド?JDK8 +のサポートなし)
  5. DCEVM(無料-オープンソース-本当にhotgrinning :)

DCEVM +ホットスワップエージェント:thumbsup:を選択します

DCEVMのインストール

手順:
1. Download latest release of DCEVM Java patch and launch the installer with sudo(e.g. sudo java -jar DCEVM-light-8u51-installer.jar). Currently you need to select correct installer for Java 8.
2. Select java installation directory on your disc and press "Install DCEVM as altjvm" button. JDK version 1.8.0_45 is recommended. download here
DCEVM
3. Download latest release of Hotswap agent jar, unpack hotswap-agent.jar and put it anywhere on your disc. For example: C:\java\hotswap-agent.jar
4. Installation is done!
5. More info here

Start with HotSwapAgent plugin for IntelliJ IDEA.

steps:
1. Install HotSwapAgent plugin for IntelliJ IDEA.
[图片上传失败...(image-cda5ba-1601023884060)]
2. Enable HotSwapAgent plugin for all configurations (or one by one).
enable
3. Start the application in DEBUG mode. You will see HOTSWAP AGENT notification in your console in case if setup was correctly done.
[图片上传失败...(image-74bfa5-1601023884060)]
4. Be sure that you have "Reload classes after compilation: Always" ON in IntelliJ IDEA in HotSwap section in your IDEA preferences.
image
5. To re-deploying changed classes in IDEA press keys combination (: Command+Shift+F9/ ⊞: Ctrl+Shift+F9) to compile the current file

:information_source: Instead of compiling the classes manually you can use the Save Action plug-in, which can trigger the compilation automatically and thus enabling "hotswap on save".

Happy:heart: Hot Swapping!

  1. change method name & then press (: Command+Shift+F9/ ⊞: Ctrl+Shift+F9)

  2. add new method & then press (: Command+Shift+F9/ ⊞: Ctrl+Shift+F9)

    change_02

More info: DCEVM & HotswapAgent

おすすめ

転載: blog.csdn.net/universsky2015/article/details/108809969
おすすめ