Authentication “随机”;401“未经授权”;将包上载到Nexus时出错

Authentication “随机”;401“未经授权”;将包上载到Nexus时出错,authentication,nexus3,Authentication,Nexus3,我正在使用curl命令将包上载到Nexus Repo Manager: 例如: curl -v -u mvn-deploy:password -T a.ear https://nexus.url:8443/repository/release/group/a/12.0.1/a-12.0.1.jar 该命令有时工作正常,但有时会出现“401 Unauthorized”错误而失败。这让我很烦恼,因为失败似乎很随机。在使用Maven时,我还可以看到相同的随机“401”错误 以下是curl的输出: *

我正在使用curl命令将包上载到Nexus Repo Manager:

例如:

curl -v -u mvn-deploy:password -T a.ear https://nexus.url:8443/repository/release/group/a/12.0.1/a-12.0.1.jar
该命令有时工作正常,但有时会出现“401 Unauthorized”错误而失败。这让我很烦恼,因为失败似乎很随机。在使用Maven时,我还可以看到相同的随机“401”错误

以下是curl的输出:

* Server auth using Basic with user 'mvn-deploy'
> PUT /a.jar HTTP/1.1
> Authorization: Basic bXZuLWRlcGxveTppTXV4UkZDQTQ1TFkzcFQ0S0U3QVB3T2VoZ0o0c0tFLWVVdm5ZRzF6c1NnVw==
> User-Agent: curl/7.29.0
> Host: nexus.url:8443
> Accept: */*
> Content-Length: 74538424
> Expect: 100-continue
> 
< HTTP/1.1 401 Unauthorized
< Date: Mon, 31 May 2021 12:55:14 GMT
< Strict-Transport-Security: max-age=7776000
< Server: Nexus/3.29.2-02 (PRO)
< X-Content-Type-Options: nosniff
* Authentication problem. Ignoring this.
< WWW-Authenticate: BASIC realm="Sonatype Nexus Repository Manager"
< Connection: close
< 
{ [data not shown]
*使用Basic和用户“mvn部署”进行服务器身份验证
>PUT/a.jar HTTP/1.1
>授权:基本BXZULWRLCGXVETPTXV4UKZDQTQ1TFKZCFQ0S0U3QVB3T2VOZ0O0CFLWVDM5ZRZF6C1NNVW==
>用户代理:curl/7.29.0
>主机:nexus.url:8443
>接受:*/*
>内容长度:74538424
>预期:100人继续
>