首先,pom文件下的build标签下的plugins标签下的plugin标签添加tomcat的插件
path为初始路径
port为端口号
<plugin>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat7-maven-plugin</artifactId>
<configuration>
<path>/</path>
<port>8082</port>
</configuration>
</plugin>