When working on IntelliJ, you have to recompile your source code every time files change. This post will show how to Spring Boot hot swap with Intellij IDE.
Table of contents
1. Adding devtools to your project
- Maven
1 2 3 4 |
<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-devtools</artifactId> </dependency> |
- Gradle
1 2 3 |
dependencies { compile("org.springframework.boot:spring-boot-devtools") } |
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 :
1 |
compiler.automake.allow.when.app.running |
Now your Spring Boot application will restart every time changes are made.