breakpoint debugging for Web projects in Eclipse for Gradle+jetty deployment (original)

Source: Internet
Author: User

1. Configure the Java, Resourece, and WebApp folders in Build.gradle files and in accordance with the Gradle Web project directory structure specification

The "HTTP port" can be set freely in the Build.gradle file

1 Jettyrun {2     3     Scanintervalseconds = 14     httpport = 12345     stopport = 43216     stopkey = ' Stop ' C12>7 }

2. Next, after deploying the Web project with Gradle (self-completed)

In the Windows environment:

Enter it separately under the CMD command line to make the bat script:

1 Set gradle_opts=-xdebug-xrunjdwp:server=y,transport=dt_socket,address=5566,suspend=n 2 gradle Jettyrun

Linux Environment:

Also the command line input, can be made into the SH script:

1 export gradle_opts= "-xdebug-xrunjdwp:transport=dt_socket,address=5566,server=y,suspend=n"; 2 gradle jettyrun;

This successfully launches the Jetty container and listens for HTTP port number 1234 (set above) and socket port number 5566 (set at the command line above, only for use with the Eclipse Remote debugging feature mentioned below)

3. Start Eclipse,

Run-->debug configuration-->remote Java application--> right-click New

--Set up the above deployed Web project and the address you want to access, port number fill in the socket port number set above 5566--> click "Debug"! (Spit trough Eclipse, here the successful operation without any hint, only the toolbar icon changes, at first I was puzzled to die)

----"The icon here indicates that the remote debugging connection was successful! Congratulations ~

4. Browser input the address of the page you want to visit! Note that the IP, port number must be filled out correctly.

breakpoint debugging for Web projects in Eclipse for Gradle+jetty deployment (original)

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.