Jenkins WAR deployment

我怕爱的太早我们不能终老 提交于 2019-12-24 13:03:39

问题


I am trying to deploy WAR from Jenkins to tomcat6.0.39 server using shell command but it is unable to deploy and throwing Authorization error:

401 Unauthorized

You are not authorized to view this page. If you have not changed any configuration files, please examine the file conf/tomcat-users.xml in your installation. That file must contain the credentials to let you use this webapp.

Following is my shell command:

curl -T $WORKSPACE/target/myapp-1.0-RC1.war 'http://serverIP:8080/manager/deploy?update=true&path=/myapp'-u username:password

However the above command works fine with my tomcat 6.0.24. I did define tomcat user role as manager-gui and manager-script and manager-jmx as per tomcat documentation that Tomcat 6.0.30 onwards, the roles required to use the manager application were changed from the single manager role to the following four roles.

  • manager-gui
  • manager-script
  • manager-jmx
  • manager-status

Following is my tomcat-users.xml content:

<tomcat-users>
 <user username="managergui" password="tomcatManager" roles="manager-gui"/>
  <user username="manager" password="tomcatManager" roles="manager-script"/>

Whats wrong I am doing in tomcat-users.xml or in my shell command which is leading to Authorization exception.


回答1:


Don't "copy" the war with a curl command. Deploy the application with Jenkins Deploy plugin it will simplify your process.



来源:https://stackoverflow.com/questions/29829960/jenkins-war-deployment

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!