To be able to test your project using MAVEN's jetty plug-in, you need to do the following:
(1) Modify the MAVEN configuration file
In order to be able to use the jetty command at the command line, you need to modify the MAVEN configuration file Settings.xml file and add the following configuration code:
[HTML] View plain copy <pluginGroup>org.mortbay.jetty</pluginGroup>
(2) Modify the project Pom.xml file
[html] View plain copy <span style= "White-space:pre" > </span> <plugin> <groupid >org.mortbay.jetty</groupId> <artifactId>jetty-maven-plugin</artifactId> <version>7.6.10.v20130312</version> <configuration> < scanintervalsecond>10</scanintervalsecond> <webApp> <contextpath>/test</contextpath> </ webapp> <connectors> <connector implementation= " Org.eclipse.jetty.server.nio.SelectChannelConnector "> <port >8787</port> <maxidletime>60000</ maxidletime> </ connector> </connectors> </configuration> </plugin> where Scanintervalsecond represents the time interval for scanning item changes, the default is 0, which means no scan.
ContextPath represents the access path for the project, than this: http://localhost:8787/test/
Port represents the bound port number, and the default listener is 8080.
(3) command line start jetty
Open a command prompt and enter the following:
[HTML] View plain copy