By running the app in debugging mode (spring-boot:run) with IntelliJ Idea CE, no breakpoints work at all when using Spring Boot 2.2. Instead, when rolling back to Spring Boot 2.1.1, everything works fine. What am I doing wrong? Is there an option/flag to add for 2.2 to make the debugger work?
When debugging a SpringBoot application in IntelliJ Idea Community Edition, additional steps need to be taken. If you have defined your run configuration as spring-boot:run, you will find that the application runs, but does not stop at breakpoints as expected. An easy way to resolve this is to set the spring-boot.run.fork property to false.
Spring Initializr is a web application that can generate a Spring Boot project. You can select the necessary configuration, including the build tool, language, version of the Spring Boot framework, and any dependencies for your project. IntelliJ IDEA provides the Spring Initializr project wizard that integrates with the Spring Initializr API to ...
When running the application in debug mode, the IntelliJ debugger attaches to the Java process that it starts itself (by appending the appropriate parameters, -agentlib:jdwp etc, to the Java command line).
The release notes indicate that the Spring Boot Maven Plugin now forks the process by default which is the reason why you can't debug the application as you used to with 2.1. If you really have to run the app using the maven plugin, you can disable forking the process (e.g. using -Dspring-boot.run.fork=false)
I would recommend running the app directly from the IDE rather than using mvn spring-boot:run
. Doing so will give you the best experience in the IDE.
The release notes indicate that the Spring Boot Maven Plugin now forks the process by default which is the reason why you can't debug the application as you used to with 2.1
. If you really have to run the app using the maven plugin, you can disable forking the process (e.g. using -Dspring-boot.run.fork=false
)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With