Jenkins部署war包
1、Tomcat开启远程部署
编辑tomcat/conf/tomcat-users.xml
<role rolename="manager-script"/>
<role rolename="manager-jmx"/>
<role rolename="manager-status"/>
<role rolename="manager"/>
<role rolename="manager-gui"/>
<user username="rayfoo" password="3992209a." roles="manager,
manager-gui,manager-script,manager-jmx,manager-status"/>
注释tomcat/webapps/manager/META-INF
<Valve className="org.apache.catalina.valves.RemoteAddrValve"
allow="127\.\d+\.\d+\.\d+|::1|0:0:0:0:0:0:0:1" />
重启tomcat
cd tomcat/bin
sh shutdown.sh
sh startup.sh
2、在Jenkins中新建一个maven项目并配置
配置git
配置git仓库地址
配置git的分支名称
![image-20211107223035947](/Users/zhangruifeng/Library/Application Support/typora-user-images/image-20211107223035947.png)
配置build 构建设置
添加maven命令
添加war包目录
添加一个tomcat容器,编辑账号和URL
![image-20211107223332547](/Users/zhangruifeng/Library/Application Support/typora-user-images/image-20211107223332547.png)