Sonatype的的Nexus REST API获取最新版本的版本 [英] Sonatype Nexus REST Api fetch latest build version
问题描述
如何可以使用Sonatype的REST API来获取最高版本的内部版本(最新版本时间)?
<$p$p><$c$c>http://MY_REPOSITORY/nexus/service/local/lucene/search?a=ARTIFACT_NAME&v=ARTIFACT_VERSION传递一个构建版本号为 ARTIFACT_VERSION
的作品。通过 V =最新
或 V =最新
不返回最新版本。
这不是记载,/服务/本地/ Lucene的/搜索支持最新的作为版本参数[<一个href=\"https://repository.sonatype.org/nexus-indexer-lucene-plugin/default/docs/path__lucene_search.html\">link]
该 /服务/本地/神器/行家的OSS REST API文档状态
[<一个href=\"https://oss.sonatype.org/nexus-restlet1x-plugin/default/docs/path__artifact_maven.html\">link] (获取神器POM文件)和 /服务/本地/神器/行家/内容
[<一个href=\"https://oss.sonatype.org/nexus-restlet1x-plugin/default/docs/path__artifact_maven_content.html\">link] (获得实际的文件内容)不支持它:
神器(必需)版本支持的最新的解决,
放和快照版本(1.0-SNAPSHOT)了。
块引用>所以,我认为你应该使用其中一个(你将不得不与repositoryId和的groupId也提供它们)
<$p$p><$c$c>http://MY_REPOSITORY/nexus/service/local/artifact/maven/content?r=repoId&g=groupName&a=art&v=LATEST
例如:
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
Passing a build version as
ARTIFACT_VERSION
works. Passingv=LATEST
orv=latest
does NOT return the latest build.解决方案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:Version of the artifact (Required) Supports resolving of "LATEST", "RELEASE" and snapshot versions ("1.0-SNAPSHOT") too.
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屋!