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:

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?


I follow the instruction below but it doesn't work as expected.

I would like to achieve te same Eclipse behaviour:

Starting the app with Boot Dashboard when I modify some classes (or any other file) the app restart automatically in less than 2 seconds.

With IntelliJ CE I don't have the Boot Dashboard but I can run my webapp as Java Application. But even if I set the build automatically option the app doesn't restart automatically and I have to stop or restart it manually.

N.B.: Run as JavaApplication is the only way to debug the app. If I perform a maven spring-boot:run configuration I must use the remote debug.


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.