关联2在“原始"文件中获取文件的校验和.资料库 [英] nexus 2 get checksum of file in "raw" repository
本文介绍了关联2在“原始"文件中获取文件的校验和.资料库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
使用sonatype nexus 2.x,如何使用curl获取站点存储库"(在nexus 3中称为原始存储库")中文件的sha1或md5哈希?
Using sonatype nexus 2.x, how do you get the sha1 or md5 hash of a file in a "site repository" (called "raw repositories" in nexus 3) using curl?
SO上有一个相关问题,但是它仅适用于具有不同api端点的"maven"存储库.
There is a related question on SO, however it only applies to "maven" repositories, which has a different api endpoint.
推荐答案
获取下载链接并附加?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
The optional -H "Accept:application/json"
curl flag returns json instead of 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支持.
Thanks to Rich @ sonatype support.
这篇关于关联2在“原始"文件中获取文件的校验和.资料库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文