方法一
<plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>tomcat-maven-plugin</artifactId> <version>1.1</version> <configuration> <path>/appname</path> <port>9090</port> <uriEncoding>UTF-8</uriEncoding> <url>http://localhost:9090/manager/html</url> <server>tomcat6</server> </configuration> </plugin>
方法二
<plugin> <groupId>org.apache.tomcat.maven</groupId> <artifactId>tomcat7-maven-plugin</artifactId> <version>2.2</version> <configuration> <port>8090</port> <path>/</path> </configuration> </plugin>
指定端口运行
mvn clean -Dmaven.tomcat.port=8181 tomcat:run