Could not HEAD ‘XXX.jar‘. Received status code 401 from server: Unauthorized

今天在部署服务的时候,一个包引用不到编译出问题了,报错如下:

   > Could not download JwtPermission.jar (com.github.whvcse:JwtPermission:1.0.9)
      > Could not get resource 'https://jitpack.io/com/github/whvcse/JwtPermission/1.0.9/JwtPermission-1.0.9.jar'.
         > Could not HEAD 'https://jitpack.io/com/github/whvcse/JwtPermission/1.0.9/JwtPermission-1.0.9.jar'. Received status code 401 from server: Unauthorized

点开这个链接需要登录,

解决方案:

在使用的具体服务上:单独引用,再加上对应的版本号,就可以解决了;

第1://compile "com.github.whvcse:JwtPermission" 把引用配置中心加载的注释掉阿

第2:// maven { url 'https://jitpack.io' }  把这行也注释掉
用公司的仓库或者阿里云的仓库
repositories {
    maven { url 'https://maven.aliyun.com/nexus/content/groups/public/' }
    // maven { url 'https://jitpack.io' }
    mavenCentral()

    maven {
        name 'nexus'
        url "http://xxx:ip/repository/maven-releases/"
        credentials {
            username project.username
            password project.userpassword
        }
    }
    maven {
        name 'nexus'
        url "http://xxx:ip/repository/maven-snapshots/"
        credentials {
            username project.username
            password project.userpassword
        }
    }
第3: 直接引用目标包,包括目标版本号
compile "com.github.whvcse:JwtPermission:1.0.9" 
compile "io.jsonwebtoken:jjwt:0.6.0"

我的是gradle的,在build.gradle文件中添加这个,单独引用。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值