I'm trying to use the /rest/beta/search/assets/download to download a jar file:
org/foo/project/1.0.0/project-1.0.0.jar
To do this, I used:
But this always fails with a 400 response. The logs show that the reason for this is multiple files are found. Using the/rest/beta/search/assets endpoit I find that the reason is there is also a jar with a classifier:
{ "items": [ { "downloadUrl": "http://localhost:8081/nexus/repository/maven-releases/org/foo/project/1.0.0/project-1.0.0-sources.jar", "path": "org/foo/project/1.0.0/project-1.0.0-sources.jar", "id": "bWF2ZW4tcmVsZWFzZXM6MTNiMjllNDQ5ZjBlM2I4ZDZjY2FjMTNjZThmMjM0ZjI", "repository": "maven-releases", "format": "maven2", "checksum": { "sha1": "8306d184746628c57a5137f3f78835cc3b8b64f8", "md5": "16d213a2fc0dc663dd1e6b3beaf56f6a" } }, { "downloadUrl": "http://localhost:8081/nexus/repository/maven-releases/org/foo/project/1.0.0/project-1.0.0.jar", "path": "org/foo/project/1.0.0/project-1.0.0.jar", "id": "bWF2ZW4tcmVsZWFzZXM6ZDQ4MTE3NTQxZGNiODllY2Y2YzZjM2VlOGQyM2U3NGU", "repository": "maven-releases", "format": "maven2", "checksum": { "sha1": "76bc8bf5b351aa33a5ce16a4b24434f50634dead", "md5": "b2ec6a8bbe094c2d00e074e04bab60f3" } } ], "continuationToken": null }
I can find no way to create a search that does not match the classifier. So I always get two results, and I cannot download this file directly by REST API.
This is either a bug in the API, or a bug in the documentation. If the latter, the REST API documentation should show how to search for an empty classifier.
- is duplicated by
-
NEXUS-20868 Nexus REST API to download artifacts with classifier
-
- Closed
-
- relates
-
NEXUS-16425 Download Endpoint Returns Checksum Files if Maven Classifier Param is Set
-
- Closed
-