Repository Import

The Repository - Import external files task will take content from a directory on the server and import it into the desired repository in Nexus Repository Manager. This will allow you to get external content into a repository from any source, even Nexus Repository Manager 2.

Available in Nexus Repository Manager Pro only

Configuration

Create a new Repository - Import external files task and you will be presented with the configuration options listed below:

A number of these fields are common to all tasks, so won't go into details here, but the import specific fields are as follows:

Target repository - The repository to import content into. This list will only be popluated with Hosted repositories of the supported Formats (see format list below).

Source directory - The directory to import content from. NOTE: files in this directory should be in a directory structure that supports the desired format (see format list below).

The source directory must be writable by the user running Nexus Repository Manager 3.  The import history is stored in the source directory to enable incremental imports.

Usage

The task can be configured to run manually, or on a schedule fitting your needs. And when the task runs, it generates a .nexus directory inside of the source directory, that contains some metadata we use for future imports, so that content won't be imported multiple times if the task is run more than once. This will allow you to keep placing content into this directory, and the next time the import task runs, only the newer content will be imported.

When importing from Nexus Repository Manager 2 repositories, the task will also pull the date/time related attributes so the data will be maintained in the new repository, these are the created date, last updated date and the last downloaded date.

As the import is processing, every single file that is imported will be logged to the task log (a new task log is created each time a task runs), along with any errors that may have occurred. If an error occurs with any particular file, we will simply log that fact, then continue on importing the rest of the content.

Hidden files and directories (having names that start with a period) will not be imported.

Supported Formats

Currently content can be imported into repositories of any format listed below. Some formats require that content be structured in a certain manner, as spoken to in the following table:


FormatSinceDirectory Layout
Raw3.23.0No specific layout required, content will simply be imported exactly as laid out in the source directory
Maven3.23.0

Files need to be laid out in the usual maven GAV structure, /(groupId)/(artifactId)/(version)/(artifactId-version.extension)

For example:

{rootdir}/com/mycompany/awesome-artifact/1.0/awesome-artifact-1.0.jar

maven-metadata files at each level (G, A or V) will also be imported.

npm3.25.0No specific layout required, will simply import all tgz packages contained in the source directory
NuGet3.25.0No specific layout required, will simply import all nuget packages contained in the source directory
Docker3.26.0

V1

  • Image metadata must be stored in the file v1/images/{layerId}/json
  • Image content must be stored in the file v1/images/{layerId}/layer
  • Tags must be stored in the file v1/repositories/{name}/tags/{tag}
  • Image index must be stored in the file v1/repositories/{name}/images/{image}

V2

  • Blobs must be stored in path /v2/-/blobs/{digest}
  • Manifests must be stored in file /v2/{name}/manifests/{tag}

Examples:

(Note the &#58 in the following path, this is simply an ascii encoded colon ':' as windows file systems do not support this character in the filename)

{rootdir}/v2/-/blobs/sha256&#5803f4658f8b782e12230c1783426bd3bacce651ce582a4ffb6fbbfa2079428ecb

{rootdir}/v2/helloworld/manifests/latest

{rootdir}/v2/helloworld/manifests/1.0

PyPI3.26.0No specific layout required, will simply import all archives contained in the source directory (along with any .asc signature files alongside them)
RubyGems3.26.0No specific layout required, will simply import all gem files contained in the source directory
Yum3.26.0

No specific layout required, will simply import all of the rpm (or drpm) files, as well as any comps.xml files in the source directory