使用maven的tomcat插件运行项目

maven中提供了tomcat7-maven-plugin插件,可以不用配置本地tomcat服务器。

1、在pom中添加配置

 1 <build>
 2             <!-- 本地tomcat7插件 -->
 3             <plugin>
 4                 <groupId>org.apache.tomcat.maven</groupId>
 5                 <artifactId>tomcat7-maven-plugin</artifactId>
 6                 <version>2.1</version>
 7                 <configuration>
 8                     <path>/</path>
 9                     <uriEncoding>UTF-8</uriEncoding>
10                     <port>8888</port>
11                 </configuration>
12             </plugin>
13         </plugins>
14     </build>
pom.xml

 2、设置maven命令行

点击工具栏run->edit configurations,出现如下窗口;输入tomcat7:run

 

posted @ 2017-06-26 16:47  转瞬  阅读(2296)  评论(0)    收藏  举报