In the Java Web project, the pom. xml file initially creates the Jetty runtime environment.

Source: Internet
Author: User

In the Java Web project, the pom. xml file initially creates the Jetty runtime environment.

In the Java Web project, the pom. xml file initially creates the Jetty runtime environment.

1. pom. xml file encoding settings

<? Xml version = "1.0" encoding = "UTF-8"?>

2. attribute settings

<Properties>
<! -- General Attributes -->
<Java. version> 1.6 </java. version>
<Project. build. sourceEncoding> UTF-8 </project. build. sourceEncoding>
<Project. reporting. outputEncoding> UTF-8 </project. reporting. outputEncoding>
 
<! -- Jetty attribute to ensure the Java web runtime environment -->
<Jetty. version> 8.1.9.v20130131 </jetty. version>
</Properties>

3. Dependency settings

<Dependencies>
<! -- Jetty -->
<Dependency>
<GroupId> org. eclipse. jetty. aggregate </groupId>
<ArtifactId> jetty-webapp </artifactId>
<Version >$ {jetty. version} </version>
<Scope> test </scope>
</Dependency>
<Dependency>
<GroupId> org. eclipse. jetty </groupId>
<ArtifactId> jetty-jsp </artifactId>
<Version >$ {jetty. version} </version>
<Scope> test </scope>
</Dependency>
</Dependencies>

4. Run plug-in settings

<Build>
<Plugins>
<! -- Jetty plug-in, set context path and spring profile -->
<Plugin>
<GroupId> org. mortbay. jetty </groupId>
<ArtifactId> jetty-maven-plugin </artifactId>
<Version >$ {jetty. version} </version>
<Configuration>
<SystemProperties>
<SystemProperty>
<Name> spring. profiles. active </name>
<Value> development </value>
</SystemProperty>
</SystemProperties>
<UseTestClasspath> true </useTestClasspath>
<WebAppConfig>
<ContextPath>/$ {project. artifactId} </contextPath>
</WebAppConfig>
</Configuration>
</Plugin>
</Plugins>
</Build>

Use Jetty as an Embedded Server

Jetty source code analysis

Jetty installation learning and demonstration

Install Jetty in Eclipse

Jetty details: click here
Jetty's: click here

This article permanently updates the link address:

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.