Search code examples
mavendockernpmnexus3

How to get a list of components and related assets out of Nexus3?


I am trying to export assets out of Sonatype Nexus3 so that I can refactor our software artifact persistence. Primarily I want to use Nexus3 as a mirror/grouping tool for disparate repositories and not push to it directly as we currently do. For this to work I need to extract all of our Docker, Maven, and NPM components/assets out of it. The problem is, Nexus3 uses blob stores for asset persistence and I want the raw assets out.

Docker images are easy. I can just walk each repository's Docker Registry API to get a list of images to pull and then push them to a new location.

For Maven artifacts, however (and I assume this applies to NPM artifacts as well), I am unable to export repositories using something like the Maven Wagon Plugin's copy goal or just about anything else because all solutions that I have seen rely on directory listing which has not been implemented in Nexus3.

If I was able to get a listing of all components and associated assets in the Nexus3 hosted repositories this would be tedious but good enough to script. Is there some CLI or API trick to extracting such info out of Nexus3? Is there a query I can run against the embedded OrientDB instance after logging into the Karaf OSGi console?

Looking for some pointers!


Solution

  • You might find some help in the answer here: Using the Nexus3 API how do I get a list of artifacts in a repository

    I think this will get you where you need to be :)