上传Maven仓库401Content错误以及更新OSSRH二重验证

原文链接

欢迎大家对于本站的访问 - AsterCasc

前言

如果有在Maven仓库上传过包的小伙伴,最近应该收到了中央仓库的邮件,提示需要使用用户令牌进行身份验证,而不是原来的账号的密码:

Dear Maven Central publisher,

We are making changes to the OSSRH authentication backend. For most users this should be a transparent process, and you should be able to continue to use your existing username and password to connect the Nexus UI. In case you need to update your password, please follow our documentation.

To configure a publisher’s plugin authentication you would need to update your plugin settings to use a user token instead of the Nexus UI username and password login.

For more information about publishing to legacy OSSRH please consult our documentation at https://central.sonatype.org/register/legacy/

Thank you,
The Central Team

如果我们未收到或者忽略这条邮件,则会在上传maven包的时候,得到401 Content access is protected by token的错误

解决方案

使用新的验证方式即可,登录Maven Centarl Respository

  1. 点击右上角用户名,选择Profile
  2. 将下拉框设置为User Token
  3. 添加生成Token
  4. 将提供的<server>标签内容复制到本地setting.xml文件中,替换原有的账号密码的验证方式
  5. 替换server::id为原有值

此时重新发布maven包即可成功

原文链接

欢迎大家对于本站的访问 - AsterCasc

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值