Sonatype Nexus REST Api 获取最新构建版本 [英] Sonatype Nexus REST Api fetch latest build version

查看:78
本文介绍了Sonatype Nexus REST Api 获取最新构建版本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何使用 Sonatype REST Api 获取具有最高版本(最新临时构建)的构建?

How can I can use the Sonatype REST Api to fetch the build with the highest version (latest temporal build)?

http://MY_REPOSITORY/nexus/service/local/lucene/search?a=ARTIFACT_NAME&v=ARTIFACT_VERSION

将构建版本作为 ARTIFACT_VERSION 传递有效.传递 v=LATESTv=latest 不会返回最新版本.

Passing a build version as ARTIFACT_VERSION works. Passing v=LATEST or v=latest does NOT return the latest build.

推荐答案

没有记录表明/service/local/lucene/search 支持LATEST"作为版本参数 [链接]OSS rest api 文档指出 /service/local/artifact/maven [link](获取工件 pom 文件)和 /service/local/artifact/maven/content [link](获取实际文件内容)确实支持它:

It is not documented that /service/local/lucene/search support "LATEST" as version parameter [link] The OSS rest api documentation states that /service/local/artifact/maven [link] (to get the artifact pom file) and /service/local/artifact/maven/content [link] (to get the actual file content) does support it:

工件的版本(必需)支持解析最新",RELEASE"和快照版本(1.0-SNAPSHOT")也是如此.

Version of the artifact (Required) Supports resolving of "LATEST", "RELEASE" and snapshot versions ("1.0-SNAPSHOT") too.

所以我认为您应该使用其中之一(您还必须为它们提供 repositoryId 和 groupId)例如:

So I think you should use one of them (you will have to supply them also with repositoryId and groupId) for example:

http://MY_REPOSITORY/nexus/service/local/artifact/maven/content?r=repoId&g=groupName&a=art&v=LATEST

这篇关于Sonatype Nexus REST Api 获取最新构建版本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆