Fast determination of available versions in a custom ivy layout repository

I want to outline, what we do.

We have to cope with an ivy custom layout and artefacts which are put into it. We need to find all available versions in a certain directory. Since we can’t properly use the search api because GAV search is only supported for maven artifacts and not for custom ivy layouts, we have implemented an mechanism to fetch all assets using pagination from the nexus 3 api. Unfortunately, when run, this takes too much of time because the selection of which assets have to be looked for, is not reducable. That is, you seem to have to consume all artefacts using pagination, which is already taking too much time.

Our general goal is to collect all versions in a certain group directory and prepare them to get into a selection box in jenkins on a manual startup.

I’m thinking of the following procedures:

a) Using a script to prepare the collection directly on the server? (Is it faster? How can I find about the API that can be used within such a script?)

b) Writing some kind of “plugin” to perform the task. (Is it possible at all, how to get into it?)

c) Possible extension of the assets api to support server side file system based reduction of results? Or extending search api to custom ivy layouts?

d) Possibly the most simple: Support custom ivy layout by defining it in the nexus administration? (May be I missed a switch…)

I’m happy for all your suggestions.

If nothing works, possibly we have to run some scheduled tooling which performs the long running pagination fetch and saves the results, so our jenkins pipeline can consume it from there. (We would avoid such an overhead.)

Thanks,
Fred

Can you use a prefix for your search? i.e. /foo/bar/*

You could also write a custom repository format there are some samples e.g. - nexus-repository-composer these could also give an example about how to write your own plugin.

There is public code for parts of Nexus, here’s a link to a random REST endpoint

Thanks for the answer. No, with the asset api, there’s only a complete list returned, paginated. It can only be reduced to a single repository. It takes “years” to gather all of it.

I’ve tried to get it by using the network analysis tool of my browser. I see before login there’s an Cookie: NX-ANTI-CSRF-TOKEN and then the user session set to the cookie after login. I haven’t been able to reproduce this authentication chain.

The other options will create much more development effort. Probably more than I am able to do.