2015-04-26 13:39:35 +00:00
|
|
|
|
### 73.7. 远程调试一个使用Gradle启动的Spring Boot项目
|
2015-04-13 16:39:21 +00:00
|
|
|
|
|
|
|
|
|
想要为使用Gradle启动的Spring Boot应用添加一个远程调试器,你可以使用build.gradle的applicationDefaultJvmArgs属性或`--debug-jvm`命令行选项。
|
|
|
|
|
|
|
|
|
|
build.gradle:
|
|
|
|
|
```gradle
|
|
|
|
|
applicationDefaultJvmArgs = [
|
|
|
|
|
"-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=5005"
|
|
|
|
|
]
|
|
|
|
|
```
|
|
|
|
|
命令行:
|
|
|
|
|
```shell
|
|
|
|
|
$ gradle run --debug-jvm
|
|
|
|
|
```
|
|
|
|
|
详情查看[Gradle应用插件](http://www.gradle.org/docs/current/userguide/application_plugin.html)。
|