/nexus3-export

Tool to export Nexus 3 repositories in a local directory

Primary LanguageJava

Nexus 3 export tool

Purpose

The purpose of this tool is to export a repository from Sonatype Nexus 3. Since version 3, the repositories stored in Nexus are not browsable by filesystem. The tool uses the Nexus API to extract all assets of a given repository. It also supports Basic Authentication, which is useful for repositories requiring authentication.

Usage

Program takes 2 required arguments plus 1 optional:

  • URL of the Nexus repository
  • Id of the repository in Nexus (e.g. releases)
  • (Optional) The local directory for repository to export. If no one is provided, a directory is creeated in the user temp directory

Authentication

If the Nexus repoitory requires authentication, specify the username and password in credentials.properties. Also set authenticate to true.

The authentication will then be used for both the Nexus API and to download artifacts from the repository. Make sure the provided user account is allowed to access the Rest API!

Note If the password contains special characters (such as "="), place double quotes around the entire password.

Running from IDE

You can create a Run Configuration by starting the Nexus3ExportApplication class. You have to add to specify the previous program arguments.

Running from CLI

Package the application as a JAR with Maven tool:

$ mvn clean package # (or use provided mvnw tool if you do not have local maven cli tool)

Then launch the tool:

$ java -jar target\nexus3-export-1.0.jar http://url.to/nexus3 releases

License

The tool is published under MIT license.