Uploaded image for project: 'Dev - Nexus Repo'
  1. Dev - Nexus Repo
  2. NEXUS-15202

No way to download a jar through /rest/beta/search/assets/download if a jar with classifier for same GAV exists

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 3.7.0
    • Fix Version/s: 3.8.0
    • Component/s: REST
    • Labels:

      Description

      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:

      http://localhost:8081/nexus/service/siesta/rest/beta/search/assets/downlload?repository=maven-releases&maven.groupId=org.foo&maven.artifactId=project&maven.baseVersion=1.0.0&maven.extension=jar

      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.

       

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              bradbeck Brad Beck
              Reporter:
              rseddon Rich Seddon
              Last Updated By:
              Peter Lynch
              Team:
              Nexus - Core
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Date of First Response:

                  tigCommentSecurity.panel-title