tomcat7和jetty启动的pom.xml配置

                   <plugins>
		
			<!-- tomcat7 -->
			<plugin>
				<groupId>org.apache.tomcat.maven</groupId>
				<artifactId>tomcat7-maven-plugin</artifactId>
				<version>2.2</version>
				<configuration>
					<useBodyEncodingForURI>true</useBodyEncodingForURI>
					<path>/</path>
				</configuration>
			</plugin>
			<!-- jetty -->
			<plugin>
				<groupId>org.mortbay.jetty</groupId>
				<artifactId>jetty-maven-plugin</artifactId>
				<version>7.6.15.v20140411</version>
				<configuration>
					<useTestClasspath>true</useTestClasspath>
					<webAppConfig>
						<contextPath>/</contextPath>
					</webAppConfig>
				</configuration>
			</plugin>
		</plugins> 

jetty的启动方式

jetty:run -Djetty.port=8081

tomcat7的启动方式

tomcat7:run -Dmaven.tomcat.port=8080



原文地址:https://www.cnblogs.com/wzjhoutai/p/6721245.html