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)