Maven+jetty. Auto-integrated operating environment

Source: Internet
Author: User

First, create a MAVEN2 project. This will not be said.

Two. In src/main/resources, two documents can be placed on the internet to go down.

Jetty-env.xml

Webdefault.xml

Three. Add the following content to the Pom.xml

<build>
     <plugins>
       <plugin>
         <groupId>org.mortbay.jetty</groupId>
         <artifactId>maven-jetty-plugin</artifactId>
         <version>6.1.22</version>
         <configuration>
           <jettyEnvXml>src/main/resources/jetty-env.xml</jettyEnvXml>
           <webAppConfig>
             <contextPath>/</contextPath>
             <defaultsDescriptor>src/main/resources/webdefault.xml</defaultsDescriptor>
             <baseResource implementation="org.mortbay.resource.ResourceCollection">
               <resources>src/main/webapp</resources>
             </baseResource>
           </webAppConfig>
         </configuration>
       </plugin>
     </plugins>
   </build>

Four. Use Maven to automatically download the appropriate jar files, Maven-jetty-plugin and so on.

Five. Configure the operating environment

Run->external tools->external Tools Configurations

New project running environment in MAVEN build.

A. Select base directory as the current project.

B.goals:jetty:run

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.