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

API search asset return maven2 empty field #548

Open
QuentinBtd opened this issue Jan 8, 2025 · 4 comments
Open

API search asset return maven2 empty field #548

QuentinBtd opened this issue Jan 8, 2025 · 4 comments
Assignees
Labels

Comments

@QuentinBtd
Copy link

  • What problem are you trying to solve?
    Since 3.76.0, use API to seach maven2 artifact return an empty maven2 filed

When I query the URL

'https://nexus.mycompany.com/service/rest/v1/search/assets?repository=maven-public&maven.groupId=com.mycompany&maven.artifactId=app&maven.baseVersion=10.1.074&maven.extension=war&sort=version&'

I get this

{
  "items" : [ {
    "downloadUrl" : "http://nexus.mycompany.com/repository/maven-releases/com/mycompany/app/10.1.074/app-10.1.074.war",
    "path" : "/com/mycompany/app/10.1.074/app-10.1.074.war",
    "id" : "......",
    "repository" : "maven-releases",
    "format" : "maven2",
    "checksum" : {
      "sha1" : "......",
      "sha256" : "......",
      "sha512" : "......",
      "md5" : "......"
    },
    "contentType" : "application/java-archive",
    "lastModified" : "2025-01-06T13:24:00.609+00:00",
    "lastDownloaded" : "2025-01-08T08:37:56.522+00:00",
    "uploader" : "......",
    "uploaderIp" : "......",
    "fileSize" : 217262571,
    "blobCreated" : null,
    "blobStoreName" : null,
    "maven2" : { }
  } ],
  "continuationToken" : null
}%

maven2 field wasn't empty in 3.75.

  • Do you have a workaround you are using at present?
    No
  • What feature or behavior is this required for?
    API
  • How could we solve this issue? (Not knowing is okay!)
  • Tell us about your Nexus Repository deployment: what version, operating system, and database are you using?
    Docker Image of Nexus 3.76.0, running as Statefullset on K8S
  • Anything else?
@Sczuka
Copy link

Sczuka commented Jan 9, 2025

Hello,
I can confirm this issue, after upgrading yesterday evening (Nexus 3.76.0 running in a container).
Kind Regards
Armin

@morco
Copy link

morco commented Jan 9, 2025

Apparently this issue only occurs for some rest points while others still works fine, which leads to a relative easy workaround, at least for cases where one has a good amount of control of how an application interfaces to nexus. First do your search normally, than use the asset-id still properly returned in the search result to do a 2nd query directly against the specific assets in question. This responds still should have the maven2 field properly filled out, here again in pseudo code short form:

results = <your-normal-nexus-search-query>

for r in results {
  if (r == "result I want") {
    asset_info = query "<nexus-url>/service/rest/v1/assets/${r['id']}"

    print "this one is still filled and working: ${asset_info}"
  }
}

@QuentinBtd
Copy link
Author

Thanks @morco for the workaround.

FYI, the problem also appears with npm repositories.

@nida-hasan
Copy link

I'm running into the same issue with docker repositories.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants