Jenkins部署:The username you provided is not allowed to use the text-based Tomcat Manager (error 403)

1、背景及现象
今天在配置Jenkins的自动部署功能,手动构建时报“The username you provided is not allowed to use the text-based Tomcat Manager (error 403)”错误,如图
Jenkins部署:The username you provided is not allowed to use the text-based Tomcat Manager (error 403)
2、原因
用于tomcat7自动部署的管理用户必须具有manager-script角色,manager-gui角色是不够的,不然会有错误出现:
The username you provided is not allowed to use the text-based Tomcat Manager (error 403)
在/etc/tomcat7/tomcat-users.xml文件中为管理用户添加manager-script角色即可。
3、解决方法
进入到tomcat的conf目录下,编辑tomcat-users.xml配置文件
Jenkins部署:The username you provided is not allowed to use the text-based Tomcat Manager (error 403)
添加manager-script角色,并赋予角色给admin
Jenkins部署:The username you provided is not allowed to use the text-based Tomcat Manager (error 403)
4、结果
Jenkins再次手动构建则构建成功。
Jenkins部署:The username you provided is not allowed to use the text-based Tomcat Manager (error 403)

转至http://blog.csdn.net/jay_1989/article/details/52861620