<build>
<plugins>
<!-- 配置Tomcat插件 ,用於啟動項目 -->
<plugin>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat7-maven-plugin</artifactId>
<!--如果不設置,則默認為貓的自定義端口,項目路徑為http://localhost:默認端口/項目名 -->
<configuration>
<!--如果端口號改為8088:那么訪問的時候路徑的端口就要寫成8088 -->
<port>8088</port>
<!-- 如果設置為/,則項目了路徑為http://localhost:端口號 /-->
<!-- 如果設置為/lw,則項目了路徑為http://localhost:端口號/lw -->
<path>/</path>
</configuration>
</plugin>
</plugins>
</build>
使用此插件后,maven build 時的命令為:tomcat7:run 此時你會發現啟動的tomcat版本為7.x.x 而不是默認的6.x.x了
