簡體   English   中英

Sonatype Nexus 3 REST API向后兼容

[英]Sonatype Nexus 3 REST API backward compatibility

我剛剛將Nexus存儲庫從OSS 2.14.5-02升級到OSS 3.6.2-01。 我將舊版網址設置為true(如http://books.sonatype.com/nexus-book/3.1/reference/install.html#config-legacy-url中所述 ),但是REST API似乎並不落后兼容。

例如,以下REST API在我的舊Nexus服務器上工作(下載了jar): http:// old_url:8081 / nexus / service / local / artifact / maven / content?r = releases&g = my_group_id&e = jar&a = my_artificat_id&v = 4.23.9.1

雖然在新的nexus 3服務器上不起作用(我發現錯誤404): http:// new_url:8081 / nexus / service / local / artifact / maven / content?r = releases&g = my_group_id&e = jar&a = my_artificat_id&v = 4.23.9.1

我沒有找到任何關於不兼容的發行說明/文檔。 我有許多使用Nexus 2 API的客戶端,我需要對其進行修復/恢復為舊的Nexus。

在Nexus2中,/ service / local / artifact / maven / content會檢索工件: https ://repository.sonatype.org/nexus-restlet1x-plugin/default/docs/path__artifact_maven_content.html

您可以在Nexus3中執行以下操作:

/content/repositories/yourrepo/groupId/artifactId/version/filename.ext

例:

/content/repositories/myrepo/com/asprint/UtilitiesSDK/1.0/UtilitiesSDK-1.0.jar

Nexus2和Nexus3之間端點的這種不兼容性非常令人討厭,並且Nexus3中的“創建NXRM2樣式的URL功能”似乎並不涵蓋所有情況。

REST API已從Sonatype Nexus 3中刪除,但是從3.16版本開始引入了新的API。 它不是向后兼容的,但是/search/assets/download端點提供的功能與Nexus 2 /service/local/artifact/maven/content端點相似。

所以

/service/local/artifact/maven/content?r=releases&g=my_group_id&e=jar&a=my_artificat_id&v=4.23.9.1

/service/rest/v1/search/assets/download?repository=releases&maven.groupId=my_group_id&maven.extension=jar&maven.artifactId=my_artificat_id&maven.baseVersion=4.23.9.1

公告: https : //community.sonatype.com/t/nxrm-3-16-rest-search-and-filtering-enhancements/1586

文檔: https : //help.sonatype.com/repomanager3/rest-and-integration-api

您可以在Sonatype nexus 3管理菜單的“ API”下找到Swagger API文檔。 請注意,這似乎是不完整的,例如,maven.extension在此處未作為參數記錄(在編寫此答案時)。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM