Tomcat热部署就是实现不停机的发布项目和更新项目
1.修改conf目录下的tomcat-users.xml文件 在<tomcat-user>添加如下配置
[root@localhost tomcat1]# vim conf/tomcat-users.xml
2.实现热部署
2.1 通过tomcat图形化界面实现热部署(不推荐)
放问manager路径:http://192.168.88.138:8080/manager,添加war包deploy实现热部署
2.2 使用maven的插件实现热部署(推荐)
2.2.1 pom.xml配置
<build>
<!-- 配置插件 -->
<plugins>
<plugin>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat7-maven-plugin</artifactId>
<configuration>
<port>8080</port>
<!--热部署发布的路径-->
<path>/</path>
<url>http://192.168.25.135:8080/manager/text</url>
<username>kawa2016</username>
<password>kawa2016</password>
</configuration>
</plugin>
</plugins>
</build>
2.2.2 maven 执行命令
打包到本地maven库命令:maven install
部署命令: tomcat7:redeploy
3.测试