A little script for downloading all assets inside a Nexus 3 repository, following the repository's asset format. For example, fed with a Nexus 3 Maven repositories, this script yields a standard Maven repository structure containing all artifacts.
You need Python 3 to run this script. You also need to install the requirements listed in requirements.txt (e.g., using pip).
Launch the script with:
python3 nexus3_exporter.py [-h] [-o output_dir] [-u username] [-n] [-m] [-q] <server> <repo>
You have to supply two arguments:
serveris the root URL to the Nexus 3 server which contains the repository. For example, this might behttps://repo.loadingbyte.com.repois the name of the repository whose assets shall be downloaded. For example, this might bemaven-releases.
Optionally, you can supply:
-hshows a help page.-o output_dirspecifies the directory where to store the downloaded assets. If none is provided, the repository name will be used as the name of the output directory.-u usernamespecifies an HTTP Basic Auth username. You will be prompted for the password, unless you supply it via theNEXUS_PASSWORDenvironment variable.-ndisables the SHA-1 hash verification of downloaded assets.-menables mirror mode, i.e., doesn't check whether the output directory is emtpy, and skips downloading previously downloaded assets.-qprints nothing but errors and two self-destroying progress bars.
Example call:
python3 nexus3_exporter.py https://repo.loadingbyte.com maven-releases
This script only exports assets from Nexus 3 repositories, but not vice versa. For importing assets, we recommend using the official import scripts.