Ash*_*Ash 1 java spring spring-mvc intellij-idea gradle
我正在尝试使用 IntelliJ 14 Ultimate 版本调试 Spring Boot 应用程序。
由于其他问题,该应用程序不会直接在 IDE 中运行(请参见底部的屏幕截图),而是使用以下命令通过命令行运行:
./gradlew bootRun -Dspring.profiles.active=dev -Dserver.port=15020 -Dorg.gradle.jvmargs="-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5245"
Run Code Online (Sandbox Code Playgroud)
我在 IntelliJ 中的设置:
我添加了以下内容build.gradle以获取接受的配置文件和端口参数:
bootRun {
systemProperties = System.properties
}
Run Code Online (Sandbox Code Playgroud)
IntelliJ 中的调试器连接成功,但不会在设置的任何断点上暂停执行。从 IntelliJ 控制台:
Connected to the target VM, address: 'localhost:5245', transport: 'socket'
Run Code Online (Sandbox Code Playgroud)
依赖版本
在 IDE 中而非 CLI 中发生的类路径资源错误:
使用 Spring Boot 启用调试的首选方法是使用以下--debug-jvm选项:
./gradlew bootRun --debug-jvm
Run Code Online (Sandbox Code Playgroud)
以及您需要的任何其他参数。使用您帖子中指定的方法,我认为您实际上是在调试 Gradle,而不是您的应用程序。
| 归档时间: |
|
| 查看次数: |
2676 次 |
| 最近记录: |