[英]Breakpoints ignored by Intellij running Spring Boot with Gradle
I'm attempting to debug a Spring Boot application using IntelliJ 14 Ultimate edition. 我正在尝试使用IntelliJ 14 Ultimate版调试Spring Boot应用程序。
The application won't run directly in the IDE (see screenshot at the bottom) because of other issues but runs via the command line using the following command: 由于其他问题,该应用程序将不会直接在IDE中运行(请参阅底部的屏幕截图),而是使用以下命令通过命令行运行:
./gradlew bootRun -Dspring.profiles.active=dev -Dserver.port=15020 -Dorg.gradle.jvmargs="-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5245"
My setup in IntelliJ: 我在IntelliJ中的设置:
I added the following to my build.gradle
to get the profile and port arguments accepted: 我在
build.gradle
添加了以下内容,以接受配置文件和端口参数:
bootRun {
systemProperties = System.properties
}
The debugger in IntelliJ connects successfully but it will not pause execution on any breakpoints set. IntelliJ中的调试器成功连接,但不会在任何断点集上暂停执行。 From the IntelliJ console:
从IntelliJ控制台:
Connected to the target VM, address: 'localhost:5245', transport: 'socket'
Dependency Versions 依赖版本
Class path resource error that occurs in IDE and not on CLI: 在IDE中而不是在CLI上发生的类路径资源错误:
The preferred method to enable debugging with Spring Boot is to use the --debug-jvm
option: 使用Spring Boot启用调试的首选方法是使用
--debug-jvm
选项:
./gradlew bootRun --debug-jvm
Along with any other arguments you need. 以及您需要的任何其他参数。 With the method specified in your post, I think you are actually debugging Gradle, not your application.
使用您帖子中指定的方法,我认为您实际上是在调试Gradle,而不是您的应用程序。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.