Maven Run configuration spring boot unable to debug.

已回答

I'm using 'mvn spring-boot:run -f pom.xml'  command in a Maven Run configuration.   

Running the app works just fine, but if I try to start it in debug mode, it never hits any of my breakpoints. 

The same app running with a Spring Boot run configuration starts in debug mode just fine.  However, Spring Boot run does not generate a build.properties file like mvn spring-boot:run does which my app needs to be able to run correctly. 

I found this: https://intellij-support.jetbrains.com/hc/en-us/community/posts/360007199739/comments/360002405220  

Is there any way to get spring run config to both generate the BuildProperties bean that my app needs while also using the SpringBoot run configuration?

0

I'm using 'mvn spring-boot:run

In this case, the Debug option launches the debug for the Maven process, which runs the goal - it does not launch the JVM, which is forked by this process in debug mode. If you need to use Maven goal for debugging, you need to add debug arguments to the process which runs the boot run maven goal, see https://docs.spring.io/spring-boot/docs/2.0.3.RELEASE/maven-plugin/examples/run-debug.html  And then connect to this process from IDE using Remote debug run configuration: https://www.jetbrains.com/help/idea/2020.2/run-debug-configuration-remote-debug.html

0

请先登录再写评论。