3

I am using devtools in spring-boot.

    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-devtools</artifactId>
        <scope>runtime</scope>
    </dependency>

I run in debugging mode, but I cannot hit any breakpoint, the v is missing from the breakpoint indicating the class has not loaded. If I remove the devtools dependency from POM, the breakpoints start hitting. Is there a way I can use devtools and hit the breakpoints also ?

This is how I run it in debugging mode : enter image description here

Using the debug mode here.

Jesus Peralta
  • 661
  • 1
  • 8
  • 18
Bhavya Arora
  • 768
  • 3
  • 16
  • 35

1 Answers1

2

I had the same problem. I found a workaround. Use additional flag:

-Dspring-boot.run.fork=false

Possible cause(20.2 Automatic Restart): https://docs.spring.io/spring-boot/docs/2.1.9.RELEASE/reference/html/using-boot-devtools.html

As long as forking is enabled, you can also start your application by using the supported build plugins (Maven and Gradle), since DevTools needs an isolated application classloader to operate properly. By default, Gradle and Maven do that when they detect DevTools on the classpath.