Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Searching for empty "maven.classifier" doesn't work #512

Open
marcinus opened this issue Nov 12, 2024 · 0 comments
Open

Searching for empty "maven.classifier" doesn't work #512

marcinus opened this issue Nov 12, 2024 · 0 comments
Assignees
Labels
triage Issues that need to be investigated, replicated

Comments

@marcinus
Copy link

  • What problem are you trying to solve?

Neither of the following requests return any results:

http://nexus-host/service/rest/v1/search/assets?repository=company-snapshots&group=com.company.product&name=some-service&maven.baseVersion=2.0.5-SNAPSHOT&maven.extension=jar&maven.classifier=""

http://nexus-host/service/rest/v1/search/assets?repository=company-snapshots&group=com.company.product&name=some-service&maven.baseVersion=2.0.5-SNAPSHOT&maven.extension=jar&maven.classifier=

http://nexus-host/service/rest/v1/search/assets?repository=company-snapshots&group=com.company.product&name=some-service&maven.baseVersion=2.0.5-SNAPSHOT&maven.extension=jar&maven.classifier

Whereas the following returns results (the only difference is lack of maven.classifier selector)

http://nexus-host/service/rest/v1/search/assets?repository=company-snapshots&group=com.company.product&name=some-service&maven.baseVersion=2.0.5-SNAPSHOTS&maven.extension=jar

    "downloadUrl" : "http://nexus-host/repository/company-snapshots/com/company/product/some-service/2.0.5-SNAPSHOT/some-service-2.0.5-20241111.152915-3-tests.jar",
    "path" : "com/company/product/some-service/2.0.5-SNAPSHOT/some-service-2.0.5-20241111.152915-3-tests.jar",
    "id" : "XXX",
    "repository" : "company-snapshots",
    "format" : "maven2",
    "checksum" : {
      "sha1" : "XXX",
      "sha256" : "XXX",
      "sha512" : "XXX",
      "md5" : "XXX"
    },
    "contentType" : "application/java-archive",
    "lastModified" : "2024-11-11T15:30:47.693+00:00",
    "lastDownloaded" : null,
    "uploader" : "developer",
    "uploaderIp" : "XXX",
    "fileSize" : 1056248,
    "maven2" : {
      "extension" : "jar",
      "groupId" : "com.company.product",
      "classifier" : "tests",
      "artifactId" : "some-service",
      "version" : "2.0.5-20241111.152915-3"
    }
  }, {
    "downloadUrl" : "http://nexus-host/repository/company-snapshots/com/company/product/some-service/2.0.5-SNAPSHOT/some-service-2.0.5-20241111.152211-3.jar",
    "path" : "com/company/product/some-service/2.0.5-SNAPSHOT/some-service-2.0.5-20241111.152211-3.jar",
    "id" : "XXXX",
    "repository" : "company-snapshots",
    "format" : "maven2",
    "checksum" : {
      "sha1" : "XXX",
      "sha256" : "XX",
      "sha512" : "XXX",
      "md5" : "XXX"
    },
    "contentType" : "application/java-archive",
    "lastModified" : "2024-11-11T15:30:46.354+00:00",
    "lastDownloaded" : "2024-11-12T10:49:44.340+00:00",
    "uploader" : "developer",
    "uploaderIp" : "XXX",
    "fileSize" : 125574861,
    "maven2" : {
      "extension" : "jar",
      "groupId" : "com.company.product",
      "artifactId" : "some-service",
      "version" : "2.0.5-20241111.152211-3"
    }
  } ],
  "continuationToken" : null
}
  • Do you have a workaround you are using at present?

Yes. I can use the working query with jq selector:
jq -r '.items | map(select(has("maven2") and (.maven2 | has("classifier") | not))) | sort_by(.lastModified) | reverse | last | .downloadUrl'

  • What feature or behavior is this required for?

Integration with pipelines downloading the latest SNAPSHOT version.

  • How could we solve this issue? (Not knowing is okay!)

Probably there's an issue with Elasticsearch index on this property?

  • Tell us about your Nexus Repository deployment: what version, operating system, and database are you using?

OSS 3.58.1-02, RHEL8.10 and Orient Embedded DB

  • Anything else?
@mrprescott mrprescott added triage Issues that need to be investigated, replicated and removed pending labels Nov 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
triage Issues that need to be investigated, replicated
Projects
None yet
Development

No branches or pull requests

2 participants