Eclipse+Maven creates webapp project to integrate jetty server

1. Add the following configuration items to pom.xml in the newly built maven webapp project

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
<plugin>
<groupId>org.mortbay.jetty</groupId>
<artifactId>maven-jetty-plugin</artifactId>
<version>6.1.26</version>
<configuration>
<webDefaultXml>webdefault.xml</webDefaultXml>
<connectors>
<connector implementation="org.mortbay.jetty.bio.SocketConnector">
<port>8090</port>
<maxIdleTime>600000</maxIdleTime>
</connector>
</connectors>
</configuration>
</plugin>
</plugins>
</build>

 2. Copy webdefault.xml to the same directory as pom.xml

 3. Select the project----"Right click----" run as---->Run Configuration

 4. Click Run, the following screen appears in the Eclipse console

 5. Open the browser and output the following address: http://127.0.0.1:8090, the following interface appears to indicate success



 

 

Configuration files (pom.xml, webdefault.xml)

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326444421&siteId=291194637