【问题标题】:nexus 2 get checksum of file in "raw" repositorynexus 2 获取“原始”存储库中文件的校验和
【发布时间】: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


    【解决方案1】:

    获取下载链接并附加?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 的支持。

    【讨论】:

    • 我搜索了官方文档,是我遗漏了什么还是文档没有提到真实世界的 REST API 示例?
    • 已经有几年了,但当时的文档还很薄弱。 (因此产生了这个松弛溢出问题)
    • 对我不起作用。显示了很多包信息(大小、上次修改)但缺少校验和
    猜你喜欢
    • 2022-01-23
    • 2018-12-05
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2010-09-23
    • 1970-01-01
    • 1970-01-01
    • 2014-01-09
    相关资源
    最近更新 更多