Hot Deploy

Jmix supports Hot Deploy technology that helps to apply project changes to the running application immediately without restarting the application server.

The following classes and resources are hot deployed:

  • View descriptors and controllers;

  • Classes used by view controllers by instantiating them or via static methods;

  • Localized messages;

  • Menu;

  • Fetch plans;

  • Resource roles;

  • Row-level roles.

Entity classes and Spring beans are not hot deployed.

The hot deploy works as follows:

  • Studio detects changed source files and

    • if it’s a resource file, Studio copies it to the .jmix/conf directory;

    • if it’s a Java or Kotlin file, Studio compiles it and copies to the build/classes project directory.

  • When the application opens a view, it loads new classes and resources from the above directories.

The location of the directory for hot deploying resources is determined by the jmix.core.conf-dir application property. This directory is cleaned on the application start by the Before launch task configured in Run/Debug Configuration Settings.

Studio also sends signals to the application to clear appropriate caches to make it load the changed resources. These are messages cache and the configurations of fetch plans, registered views and menu. Signals are implemented as trigger files created in the .jmix/temp/triggers directory (its location can be changed by the jmix.core.temp-dir property).

The application may require 2-3 seconds to reload classes and resources after saving them in Studio. If you don’t see expected changes after opening a view, try to refresh the web page again.