用于从 Nexus OSS 3.x 存储库获取工件列表的 Rest API

标签 rest nexus sonatype

我在 Nexus 3.x 中创建了一个原始存储库,我可以将工件上传到相同的。现在我想使用 Rest API 获取驻留在该 repo 中的所有工件的列表。
任何帮助表示赞赏。

最佳答案

在当前的 Nexus3.14.0-04 中,REST API 已成为最终版本(不再是“测试版”),您需要的 curl 是:

curl -X GET "http://localhost:8081/service/rest/v1/components?repository=central "-H "accept: application/json"

这将返回每个“组件”(组、名称、版本)及其所有 Assets = 构成组件的每个单独文件(pom、sha1、md5、jar)

结果是一个 JSON 字符串。

相反,如果您想执行 COMPONENTS 搜索 - 基于 groupId、artifactId - 您可以使用此 curl:

curl -X GET "http://localhost:8081/service/rest/v1/search?repository=central&format=maven2&maven.groupId=com.fasterxml.jackson.core&maven.artifactId=jackson-core&maven.extension=jar "-H "accept: application/json"

这将返回带有子 Assets 的组件。

只检索 ASSETS 而不按 COMPONENT 对它们进行分组的变体是 GET/service/rest/v1/search/assets?repository=central&format=maven2&maven.groupId=com.fasterxml.jackson.core&maven.artifactId=jackson-core&maven.extension = jar

关于用于从 Nexus OSS 3.x 存储库获取工件列表的 Rest API,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43843273/

相关文章:

php - 使用 Codeigniter 获取 PUT 请求

gradle - 在上游依赖项已更改时促进语义版本化的工件

nexus - Nexus Repository 版本 3.2.0-01 中的 OrientDB 损坏状态

maven - 如何确定需要为 Mule ESB 添加哪些存储库到 Sonatype Nexus

c# - 如何更改 ServiceStack 中的默认 ContentType?

RESTful URI 设计 - 资源的多个 URI 用户友好

用于删除 nexus 3 上的工件的 groovy 脚本(不是 nexus 2)

maven - 从 Maven 中心动态链接到最新的 'jar-with-dependencies'

python - 新的 pypi org 代理不适用于 sonatype nexus

java - Jackson 映射对于作为参数传递的泛型失败