【问题标题】:Download latest snapshot artifact from Nexus Repository Manager OSS 3.30.0-01using wget/curl command使用 wget/curl 命令从 Nexus Repository Manager OSS 3.30.0-01 下载最新的快照工件
【发布时间】:2021-06-28 03:32:44
【问题描述】:

我在使用 wget /curl 从 Nexus Repository Manager OSS 3.30.0-01 下载最新快照版本时遇到困难

我面临的问题是,在 nexus 中,同一快照版本中有多个版本的人工制品,附加时间戳加 - 如下图所示的增量数字

那么如何从一个快照下的多个版本中下载最新的快照版本呢?

目前,我必须像下面这样明确指定版本

wget http://$NEXUS_URL/repository/mfi-snapshots/com/mf/productService/1.0.9-SNAPSHOT/productService-1.0.9-20210329.141405-11.war

那么有什么方法可以下载最新版本,只需要提到快照版本并下载最新版本

 $NEXUS_URL: is the nexus URL 
mfi-snapshots: is the snapshot repo
com.mf: is the group 
productService is the artefact
1.0.9 SNAPSHOT the version of the artefact

我尝试使用 nexus 中定义的“/v1/search/assets/download” API(不知道如何使用它

http://$NEXUS_URL/service/rest/v1/search/assets/download?sort=version&direction=desc&q=war&repository=mfi-snapshots&group=com.mf&name=productService

它给出了一个类似的 json 输出

【问题讨论】:

  • this 有帮助吗?
  • 不行,找nexus3不行,不然我错了

标签: awk wget nexus sonatype nexus3


【解决方案1】:

我按照有关 sonatype 的帮助文章中提到的步骤进行操作,得到了解决方案

https://help.sonatype.com/repomanager3/rest-and-integration-api/search-api#SearchAPI-DownloadingtheLatestVersionofanAsset

curl -L -o productService.war  -s -X GET "$NEXUS_HOST/service/rest/v1/search/assets/download?sort=version&repository=$NEXUS_SNAPSHOTS_REPO&maven.groupId=com.mf&maven.artifactId=productService&maven.baseVersion=$SNAPSHOT_VERSION&maven.extension=war" -H "accept: application/json"

【讨论】:

    猜你喜欢
    • 2016-12-14
    • 2016-11-01
    • 2022-01-01
    • 2023-03-23
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2022-01-16
    • 1970-01-01
    相关资源
    最近更新 更多