Jenkins部署:The username and password you provided are not correct (error 401)
2017-08-17 14:26
591 查看
这类错误是Jenkins部署war包到tomcat的 webapps下发生的错误
要做到这一步我们需要下载一个插件Deploy to container Plugin
然后再增加构建后操作步骤选项中选Deploy war/ear to a Container
这里面的WAR/EAR files要和项目中的build.xml文件中的一个属性保持一致如图
1、WAR/EAR files:输入war包的相对路径,如我的war包在新建目录的target下
2、context path:输入用来访问tomcat的名称,localhost:8080/p**
3、add container:增加容器,一般选tomcat 就可以。
4、tomcat-users.xml中的用户名及密码默认是注释掉的,所以需要删除注释,也可以直接复制以下代码到之前。如果只是删除注释的话好像部署不会成功,还需要增加manager开头的三个role才可以。
在使用jenkins部署项目的过程中发现build成功后会抱一个401的错误
点击图中标记的链接会跳出页面
让输入tomcat的用户名和密码,这时候点击取消
点击取消后会有提示,红框标注的意思大概是:“您没有权限查看此页。如果你没有更改任何配置文件,请检查您的安装文件conf/tomcat-users.xml。该文件必须包含证书让你使用这个程序。
例如,添加manager-gui作用一个用户名为tomcat的密码的s3cret,添加以下上面列出的配置文件。”
那么我们就按照提示去Tomcat文件夹找到相应的文件conf/tomcat-users.xml然后修改它。
我们可以看到,当我们第一次打开tomcat-users.xml这个文件的时候它的标签中间部分是被注释掉的,我们需要做的就是把注释打开并添加manager-gui
修改完之后我们在重新部署项目就不会出现以上401错误了。
要做到这一步我们需要下载一个插件Deploy to container Plugin
然后再增加构建后操作步骤选项中选Deploy war/ear to a Container
这里面的WAR/EAR files要和项目中的build.xml文件中的一个属性保持一致如图
1、WAR/EAR files:输入war包的相对路径,如我的war包在新建目录的target下
2、context path:输入用来访问tomcat的名称,localhost:8080/p**
3、add container:增加容器,一般选tomcat 就可以。
4、tomcat-users.xml中的用户名及密码默认是注释掉的,所以需要删除注释,也可以直接复制以下代码到之前。如果只是删除注释的话好像部署不会成功,还需要增加manager开头的三个role才可以。
在使用jenkins部署项目的过程中发现build成功后会抱一个401的错误
点击图中标记的链接会跳出页面
让输入tomcat的用户名和密码,这时候点击取消
点击取消后会有提示,红框标注的意思大概是:“您没有权限查看此页。如果你没有更改任何配置文件,请检查您的安装文件conf/tomcat-users.xml。该文件必须包含证书让你使用这个程序。
例如,添加manager-gui作用一个用户名为tomcat的密码的s3cret,添加以下上面列出的配置文件。”
那么我们就按照提示去Tomcat文件夹找到相应的文件conf/tomcat-users.xml然后修改它。
我们可以看到,当我们第一次打开tomcat-users.xml这个文件的时候它的标签中间部分是被注释掉的,我们需要做的就是把注释打开并添加manager-gui
修改完之后我们在重新部署项目就不会出现以上401错误了。
相关文章推荐
- Jenkins部署:The username you provided is not allowed to use the text-based Tomcat Manager (error 403)
- The password supplied with the username Domain\UserName was not correct. Verify that it was entered correctly and try again
- SharePoint创建web application出现“The password supplied with the username was not correct. Verify that it was entered correctly and try again.”错误
- The username you provided is not allowed to use the text-based Tomcat Manager (error 403)
- Login failed:make sure your username and password are correct and that you’re an admin or moderator
- Password authentication failed, Please verify that the username and password are correct
- Compiler Error Message: CS0234: The type or namespace name 'BorderDetails' does not exist in the class or namespace 'Infragistics.WebUI.Shared' (are you missing an assembly reference?)
- SharePoint创建web application出现“The password supplied with the username was not correct”错误的解决方法
- Check if the name and password are correct for domain
- The password supplied with the username Domain\UserName was not correct. Verify that it was enter...
- Check if the name and password are correct for domain
- Please enter the correct username and password for a staff account. Note tha
- The password supplied with the username Domain\UserName was not correct. Verify that it was enter...
- the server has disconnected with an error. server message reads: a protocol error occurred.chang of username or service not allowedroot, (root,ssh-con
- Could not install the app on the device, read the error above for details. Make sure you have an And
- t_user is not mapped [from t_user as u where u.loginname = :loginname and u.password =:password]
- Could not read from remote repository.Please make sure you have the correct access rights.and the re
- emulator: ERROR: You did not provide the name of an Android Virtual Device
- Compound class names are not supported. Consider searching for one class name and filtering the results
- The type or namespace name 'Bitmap' could not be found (are you missing a using directive or an asse