Rookie learn Java (19)--web Project Test Good helper, Maven+jetty

Source: Internet
Author: User

To do web development, testing is a very time-consuming thing. So we should test it in a simpler and quicker way. Let's introduce a lightweight container--jetty today. J today said Etty is a maven plug-in Jetty-maven-plugin, with Maven to use very convenient, its configuration is very simple, below we see how it works!


Under the <project> tab of the Pom.xml file, add the following code for example:

  <build><plugins><plugin><groupId>org.mortbay.jetty</groupId><artifactId> jetty-maven-plugin</artifactid><version>8.1.10.v20130312</version><configuration>< Connectors><connector implementation= "Org.eclipse.jetty.server.nio.SelectChannelConnector" ><port >8888</port></connector></connectors><webappsourcedirectory>${basedir}/webcontent </webAppSourceDirectory><scanIntervalSeconds>10</scanIntervalSeconds><webAppConfig> <contextpath>/${project.artifactid}</contextpath></webappconfig></configuration></ Plugin></plugins></build>


so the configuration is complete, then right-click on the Pom.xml file, point to Run as, select Maven build, enter "Jetty:run" in the "goals" of the pop-up form, and then click "Run".



when it appears for example the following information represents jetty startup success:

[INFO] Started Jetty Server
[INFO] Starting scanner at interval of ten seconds.


OK, how about that? Very easy, let's try it!



Rookie learn Java (19)--web Project Test Good helper, Maven+jetty

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.