我正在尝试远程调试Spring Boot 2.0 Web应用程序,使用新的Spring Boot Gradle插件构建和运行。我已经读过,要走的路是传递--debug-jvm
选项,如下所示:
./gradlew bootRun --debug-jvm
但我得到以下内容:
Problem configuring task :bootRun from command line.
> Unknown command-line option '--debug-jvm'.
Spring Boot 2.0中有什么变化,或者我错过了什么? new gradle plugin reference没有提及有关调试的任何内容。
我正在运行Spring Boot和spring-boot-gradle-plugin版本2.0.0.M6,gradle版本4.3.1。
答案 0 :(得分:3)
以下方法可行:
bootRun {
jvmArgs = ["-agentlib:jdwp=transport=dt_socket,server=y,address=8000,suspend=n"]
}
./gradlew bootRun