Issue
I have a Java 8/Spring Boot/Maven application that I can run in my IntelliJ IDE just fine. When I click the green arrow (top right corner below) a console displays and everything starts up without issue, and I can use the app in the browser, hit endpoints via curl, etc.
I am now trying to get the debugger working. When I stop the application and then restart it by clicking the debugger (green bug icon next to the play icon in the screenshot above), again the app starts up without any issue whatsoever. The problem is, the breakpoints I'm setting (prior to running) are not executing! Meaning when the app encounters a line of code with the breakpoint set, the process is not paused and I don't see IntelliJ hanging at the line of code (waiting for me to take action) like I'm used to in other projects.
For instance, above, the SpringApplication.run(...)
method has a breakpoint set on it. But when I start it up in debug mode, it just starts up and never stops at that line!
Here are my Edit Configurations settings for this project:
Does anything look off? Do I need to set up something different/special for the debugging to work? Thanks in advance.
Solution
Add <fork>false</fork>
into spring-boot-maven-plugin
configuration:
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<fork>false</fork>
</configuration>
</plugin>
Related request: IDEA-175246.
Answered By - Andrey
Answer Checked By - Cary Denson (JavaFixing Admin)