spring boot hotswap with Intellij IDE

Solution 1:

A solution that uses devTools works :

1 - Adding devtools to your project

<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-devtools</artifactId>
</dependency>

2- Enabling automatic build

Open the Settings --> Build-Execution-Deployment --> Compiler and enable :

Build Project Automatically.

3- Update the value of compiler.automake.allow.when.app.running

press ctrl+shift+A and search for the registry. In the registry, enable :

compiler.automake.allow.when.app.running

Hope it helps !


References :

  • https://dzone.com/articles/spring-boot-application-live-reload-hot-swap-with

Solution 2:

Found out the root cause. This has nothing to do with Spring-boot. On changing my groovy source files, files were not auto-compiled.

To recompile changed files and swap them:

  • Ctrl+Shift+F9 on Windows
  • Cmd+Shift+F9 on Mac