pom.xml里面的配置代碼
<build>
<plugins>
<plugin>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat7-maven-plugin</artifactId>
<configuration>
<path>/</path>
<port>8080</port>
</configuration>
</plugin>
</plugins>
</build>
這樣我們運行項目的時候就不用在使用本地的tomcat,直接在pom.xml所在的目錄下打開命令窗口(shift+目錄下右鍵菜單),執行mvn tomcat:run就可以運行項目。
