更新时间:2021-12-07 00:22:07
在pom.xm 加入以下xml。
1
2
3
4
5
6
7
8
9
10
11
12
|
< plugin >
< groupId >org.apache.tomcat.maven</ groupId >
< artifactId >tomcat7-maven-plugin</ artifactId >
< version >2.1</ version >
< configuration >
< port >9090</ port >
< path >/mgr</ path >
< uriEncoding >UTF-8</ uriEncoding >
< finalName >mgr</ finalName >
< server >tomcat7</ server >
</ configuration >
</ plugin >
|
简要说明一下:
path 是访问应用的路径
port 是tomcat 的端口号
uriEncoding URL按UTF-8进行编码,这样就解决了中文参数乱码。
Server 指定tomcat名称。
配置就这么简单,基本搞掂,下面看看如何使用。
这样Tomcat 插件就可以运行。
下面介绍几个常用的Goal
命令 | 描述 |
tomcat:deploy | 部署一个web war包 |
tomcat:reload | 重新加载web war包 |
tomcat:start |
启动tomcat |
tomcat:stop |
停止tomcat |
tomcat:undeploy |
停止一个war包 |
tomcat:run | 启动嵌入式tomcat ,并运行当前项目 |
本文转自yunlielai51CTO博客,原文链接:http://blog.51cto.com/4925054/1709973,如需转载请自行联系原作者