1 pom.xml中配置tomcat 插件
<plugin> <groupId>org.apache.tomcat.maven</groupId> <artifactId>tomcat7-maven-plugin</artifactId> <version>2.2</version> <configuration> <hostName>localhost</hostName> <!-- Default: localhost --> <port>8080</port> <!-- 啟動端口 Default:8080 --> <path>/HM-company-wx</path> <!-- 訪問應用路徑 Default: /${project.artifactId}--> <uriEncoding>UTF-8</uriEncoding> <!-- uri編碼 Default: ISO-8859-1 --> </configuration> </plugin>
2 配置命令 tomcat7:run-war
note:由於本項目是web項目,所以用的run-war命令,