Maven Eclipse Jetty Debug

Source: Internet
Author: User

You can view the latest version: Http://mvnrepository.com/artifact/org.eclipse.jetty/jetty-server

Add in Pom.xml:

<plugin>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-maven-plugin</artifactId>
<version>9.2.10.v20150310</version>
<configuration>
<stopKey>stop</stopKey>
<stopPort>5599</stopPort>
<scanIntervalSeconds>10</scanIntervalSeconds>
<webAppConfig>
<contextPath>/${project.artifactId}</contextPath>
</webAppConfig>
<connectors>
<connector implementation= "Org.eclipse.jetty.server.nio.SelectChannelConnector" >
<port>8080</port>
<maxIdleTime>60000</maxIdleTime>
</connector>
</connectors>
</configuration>
</plugin>

Mode 1-eclipse Debug:

①. Right-click Maven Project, select [Debug as] in the popup menu, first select [Maven build ...], select [Maven build] later to read the saved configuration start:


②. In the browser input address http://localhost:8080/prospect/already/mosaic.htm, add a breakpoint on the code, debug:


Mode 2-Remote debugging:

①. Select Eclipse's [run]-[external tools]-[external Tools configurations ...] Menu.

In the dialog box that opens, create a new program, enter the full path of Mvn.bat (Mvndebug.bat), specify the Web project to start, and in the Arguments box, enter Jetty:run



When using Mvn.bat, you need to add debug parameters:
To switch to the Environment option, add a variable:
maven_opts=-xdebug-xrunjdwp:transport=dt_socket,server=y,suspend=n,address=1066

Note: Address is the port that communicates with the debugger, not the service's port number.



Other parameters:
-xnoagent: Disabling the default Sun.tools.debug debugger
-djava.compiler=none: Disable the JIT compiler from loading
DT_SHMEM: Shared memory Transfer limited to Windows

Click [Run] to start the jetty server

Choose Eclipse's [run]-[debug configurations ...] menu, in the popup dialog box, create a new remote Java application, specifying the same engineering and connection properties as the external tools:



Click [Debug] to start the debug client



②. ② of the same mode 1

Maven Eclipse Jetty Debug

Related Article

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.