Gradle start Springboot Project for remote debugging

Source: Internet
Author: User

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.


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.