Original: https://blog.csdn.net/thomaschant/article/details/52669516
Gradle+springboot+idea Project for remote debugging, divided into the following 2 steps
1 Start the Springboot project using Gradle first on the server (for example: 100.10.100.200), there are two ways to set up the startup JVM parameters when booting
Method 1:build.gradle the Bootrun task to add the Jvmargs attribute
Build.gradle:
Bootrun {
Jvmargs "-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=5005"
}
Method 2 starts directly from the command line
$ gradle Bootrun--DEBUG-JVM
If configured correctly, the following log is printed during startup.
Listening for transport dt_socket at address:5005
The second step in this case is to configure locally
2 Configuring the Idea debugging environment locally
1 in the top right corner of the project launch location, select Edit configurations, in the pop-up window, to configure. Where host represents the server-side IP address that is running the project, port is the first step in Jvmargs, if it is initiated through the command line, the default is 5005, after the configuration is completed click Apply, and then click OK.
2 Boot debug mode, if the connected to the target VM appears, address: ' XX. XX.XXX.XXX:XX ', Transport: ' Socket ', indicates that the server-side program is already listening locally.