<build>

        <finalName>springmvc</finalName>

        <plugins>

            <plugin>

                <groupId>org.mortbay.jetty</groupId>

                <artifactId>jetty-maven-plugin</artifactId>

                <version>8.1.8.v20121106</version>

                <configuration>

                    <reload>manual</reload>

                    <webAppConfig>

                        <contextPath>/${project.build.finalName}</contextPath>

                    </webAppConfig>

                    <connectors>

                        <connector implementation="org.eclipse.jetty.server.nio.SelectChannelConnector">

                            <port>9080</port>

                            <!--<maxIdleTime>60000</maxIdleTime>-->

                        </connector>

                    </connectors>

                </configuration>

            </plugin>

        </plugins>

    </build>   

在cmd 里面输入mvn jetty:run即可运行

05-08 15:51