Testing using the Jetty-maven-plugin plug-in

Source: Internet
Author: User

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

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.