我正在尝试使用Jenkins部署到容器插件在远程Tomcat(远程计算机)上部署WAR.我在tomcat-users.xml中完成了以下配置
我在Jenkins deployer容器插件中设置了正确的用户名密码和端口.该设置适用于本地Tomcat.但对于远程Tomcat,我不断收到以下错误:
Caused by: org.codehaus.cargo.container.tomcat.internal.TomcatManagerException: The username you provided is not allowed to use the text-based Tomcat Manager (error 403) at org.codehaus.cargo.container.tomcat.internal.TomcatManager.invoke(TomcatManager.java:555)
at org.codehaus.cargo.container.tomcat.internal.TomcatManager.list(TomcatManager.java:686) at org.codehaus.cargo.container.tomcat.internal.TomcatManager.getStatus(TomcatManager.java:699) at org.codehaus.cargo.container.tomcat.internal.AbstractTomcatManagerDeployer.redeploy(AbstractTomcatManagerDeployer.java:174)
... 16 more Caused by: java.io.IOException: Server returned HTTP response code: 403 for URL: http://1.203.190.5:8080/manager/text/list at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(Unknown Source) at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown
Source) at org.codehaus.cargo.container.tomcat.internal.TomcatManager.invoke(TomcatManager.java:544) ... 19 more
请帮忙.
这似乎是一个Jenkins错误,但我通过在Tomcat中设置以下配置解决了这个问题:
编辑文件/webapps/manager/META-INF/context.xml:
以前:
我通过容器插件使用jenkins将工件部署到tomcat时面临同样的问题,解决方案: - 我在用户角色中添加了manager-script和manager-gui,并提供对webapps/*目录的完全访问权限.它帮助我成功部署工件并能够使用manager-app查看它.