在maven项目pom.xml中添加tomcat插件

 1 <build>
 2 <!--插件 -->
 3 <plugins>
 4 <plugin>
 5 <groupId>org.apache.tomcat.maven</groupId>
 6 <artifactId>tomcat7-maven-plugin</artifactId>
 7 <version>2.2</version>
 8 <configuration>
 9 <!--端口号 -->
10 <port>8090</port>
11 <!--项目访问的根目录 
12 url:localhost:8090/项目名称/addUser.action
13 -->
14 <path>/</path>
15 </configuration>
16 </plugin>
17 </plugins>
18 </build>
原文地址:https://www.cnblogs.com/pxffly/p/8257810.html