简体   繁体   中英

spring-boot-devtools disables debugging, cannot hit breakpoints

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 : 在此处输入图片说明

Using the debug mode here.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM