使用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

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM