参考文章:
maven tomcat plugin实现热部署:https://www.zzvips.com/article/163052.html
- tomcat 的tomcat-users.xml中添加用户;
- maven 的settings.xml中添加server;
- pom.xml中添加tomcat7-maven-plugin插件配置;
- 在tomcat运行的情况下,运行 tomcat7:deploy 命令。
1、添加用户
在 标签内:
?
|
1
2
3
4
5
6
7
8
|
<role rolename="admin"/>
<role rolename="admin-gui"/>
<role rolename="manager"/>
<role rolename="manager-script"/>
<role rolename="manager-gui"/>
<role rolename="manager-jmx"/>
<role rolename="manager-status"/>
<user username="admin" password="admin" roles="admin,manager,manager-gui,admin-gui,manager-script,manager-jmx,manager-status"/>
|
2、添加server
在 标签内:
?
|
1
2
3
4
5
|
<server>
<id>tomcat-8.0.29</id>
<username>admin</username>
<password>admin</password>
</server>
|
3、添加插件配置
?
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
|
<!-- maven tomcat plugin -->
<plugin>
<groupid>org.apache.tomcat.maven</groupid>
<artifactid>tomcat7-maven-plugin</artifactid>
<version>2.2</version>
<configuration>
<!--deploy to server-->
<url>http://localhost:8080/manager/text</url>
<server>tomcat-8.0.29</server>
<username>admin</username>
<password>admin</password>
<path>/crowfunding</path>
<port>8080</port>
</configuration>
</plugin>
|
4、运行 tomcat7:deploy
注:tomcat为运行状态方起作用,否则部署失败。
总结
以上就是这篇文章的全部内容了,希望本文的内容对大家的学习或者工作具有一定的参考学习价值,谢谢大家对快网idc的支持。如果你想了解更多相关内容请查看下面相关链接
原文链接:https://blog.csdn.net/u012099869/article/details/50449551
相关文章
猜你喜欢


