【发布时间】:2017-06-19 14:55:31
【问题描述】:
使用 sonatype nexus 2.x,如何使用 curl 获取“站点存储库”(在 nexus 3 中称为“原始存储库”)中文件的 sha1 或 md5 哈希?
There is a related question on SO,但它仅适用于“maven”存储库,它具有不同的 api 端点。
【问题讨论】:
标签: nexus
使用 sonatype nexus 2.x,如何使用 curl 获取“站点存储库”(在 nexus 3 中称为“原始存储库”)中文件的 sha1 或 md5 哈希?
There is a related question on SO,但它仅适用于“maven”存储库,它具有不同的 api 端点。
【问题讨论】:
标签: nexus
获取下载链接并附加?describe=info
curl -H "Accept:application/json" \
"http://nexus.example.com/nexus/service/local/repositories/foobar/content/master-5678.zip?describe=info"
可选的-H "Accept:application/json" curl 标志返回 json 而不是 xml
{
"data":{
"presentLocally":true,
"repositoryId":"foobar",
"repositoryName":"foobar",
"repositoryPath":"/master-5678.zip",
"mimeType":"application/zip",
"uploader":"bob",
"uploaded":1459458352000,
"lastChanged":1459458352000,
"size":715112200,
"sha1Hash":"d18dd27f4814e0898df98e7aa47cc08c477dfabc",
"md5Hash":"ded916cf74e7dd97e698285c2880e7a8",
"repositories":[
{
"repositoryId":"foobar",
"repositoryName":"foobar",
"path":"/master-5678.zip",
"artifactUrl":"http://nexus.example.com/nexus/content/repositories/foobar/master-5678.zip",
"canView":true
}
],
"canDelete":false
}
}
感谢 Rich @ sonatype 的支持。
【讨论】: