Search code examples
javaspring-bootmavenintellij-idea

IntelliJ spring-boot-devtools behavior


I'm switching from Eclipse to IntelliJ CE 2024.3.1.1 and I opened a Spring Boot 3.4.1 project create with Spring Initliazr.

As I said, I'm using Spring Boot 3.4.1, Java 21, Maven 3.9.9 (Bundled) and no others, there isn't a line of code. I have just some import:

  • spring-boot-starter-data (H2 database),
  • spring-boot-starter-web,
  • h2database,
  • spring-boot-devtools,
  • lombok (1.18.12)

I notice that, even if the spring-boot-devtools is on the pom and the Spring Assistant plugin installed, when I change something, the app doesn't reload.

Is there a way to fix that?


Solution

  • In addition to installing spring-boot-devtools, you also need to enable automatic build in IntelliJ.

    1. Open Settings
    2. Select Build, Execution, Deployment
    3. On the Compiler page, select Build project automatically.