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