- pom.xml中增加jetty的配置
<properties>
<jetty-version>8.1.13.v20130916</jetty-version>
<productionMode>false</productionMode>
</properties><build>
<plugins>
<plugin>
<groupId>org.mortbay.jetty</groupId>
<artifactId>jetty-maven-plugin</artifactId>
<configuration>
<webApp>
<contextPath>/</contextPath>
</webApp>
<stopKey>webx</stopKey>
<stopKey></stopKey>
<connectors>
<connector implementation="org.eclipse.jetty.server.nio.SelectChannelConnector">
<port></port>
<maxIdleTime></maxIdleTime>
</connector>
</connectors>
<requestLog implementation="org.eclipse.jetty.server.NCSARequestLog">
<filename>target/access.log</filename>
<retainDays></retainDays>
<append>false</append>
<extended>false</extended>
<logTimeZone>GMT+:</logTimeZone>
</requestLog>
<systemProperties>
<systemProperty>
<name>productionMode</name>
<value>${productionMode}</value>
</systemProperty>
</systemProperties>
</configuration>
</plugin>
</plugins>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.mortbay.jetty</groupId>
<artifactId>jetty-maven-plugin</artifactId>
<version>${jetty-version}</version>
</plugin>
</plugins>
</pluginManagement></build>2 idea中选择用maven启动
2、idea中选择用maven启动
3、在idea中启动
4、完成,在浏览器中输入:http://localhost:8081/xxx 即可访问了