简体   繁体   English

Intellij使用Gradle运行Spring Boot时忽略的断点

[英]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 依赖版本

  • Spring: 4.1.3.RELEASE 春季:4.1.3。发布
  • Spring Boot: 1.1.8-RELEASE 春季靴:1.1.8-释放
  • spring-boot-gradle-plugin: 1.1.12.RELEASE spring-boot-gradle-plugin:1.1.12。发布
  • Gradle 2.8 摇篮2.8

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.

相关问题 在 IntelliJ 中运行 Spring 启动 Gradle 应用程序时总是得到 404 - Always getting 404 when running Spring Boot Gradle app in IntelliJ controller 中的断点不适用于 Intellij 中的 Spring 引导应用程序 - Breakpoints in controller not Working for Spring boot app in Intellij Intellij spring boot run 不工作 gradle bootRun - Intellij spring boot run not working gradle bootRun Spring Boot 2.0 Gradle在IntelliJ中运行和测试 - Spring Boot 2.0 Gradle run and test in IntelliJ 用于gradle intellij的环境变量-Spring Boot - environment variable used with gradle intellij - spring boot Spring 启动应用程序与 IntelliJ 一起工作,但是在与 gradle bootRun 一起运行时失败并出现 NoSuchMethodError - Spring boot application works with IntelliJ, however fails with NoSuchMethodError while running with gradle bootRun 在 Intellij 上运行但不在 Tomcat 上运行的 Spring Boot 2 Maven 项目 - Spring Boot 2 Maven project running on Intellij but not on Tomcat 通过IntelliJ运行配置运行Spring引导 - Running Spring boot via IntelliJ run configuration 运行现有 spring 启动 gradle 项目的问题 - Issue running existing spring boot gradle project Spring Boot应用程序在Intellij上启动,但在Tomcat独立服务器上无法启动[Gradle] - Spring Boot Application starts on Intellij but not on Tomcat standalone [Gradle]
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM