Skip to main content

Uploading Components

When your build makes use of proprietary or custom dependencies that are not available from public repositories, you will often need to find a way to make them available to developers in a custom repository. Nexus Repository makes it easy to upload these third-party components to any of your hosted repositories via the UI, as shown below.

Before you begin

There are a few things you need before you can use this feature:

  1. The nx-component-upload privilege assigned to the user (anonymous users do not have this privilege by default, but admins do)

  2. One or more hosted repositories (only formats listed in the table below are supported)

  3. Users must have the privilege to edit the repository. It is worth noting that if a user has browse and read privileges, the user will still see the Upload button, however an message will be displayed that they are not authorized if they try to upload a file.

  4. One or more files of the proper type(s) for the intended repository format.

Valid file types for each format are enumerated here:

Repository format

Valid file types

Multiple file upload

Apt

.deb, .udeb

No

Maven (release only; upload to snapshot not allowed)

No restrictions, but common types include .pom, .jar, and .zip

Yes

Helm

.tgz, .tgz.prov

No

npm

.tgz

No

NuGet

.nupkg

No

PyPI

.tar.gz

No

R

.tar.gz, .tgz

No

Raw

No restrictions

Yes

RubyGems

.gem

No

Yum

None with permissive policy, otherwise .rpm, and .drpm

No

How to upload a component

To upload components to a repository, select a hosted repository in the Browse feature and then click on the Upload component button. This will bring up a form for you to select the file to upload and provide additional details.

Upload a component ui

The details depend on the format but, generally to upload a component, fill out all of the required fields and click on the Upload button. Once the upload completes successfully, the form will be cleared and a message appears with a link to the component you uploaded.

If you select this link, you will be taken to the Search feature where you can further inspect the component you uploaded. This is a cross-repository search, so you can easily detect whether an identical component already exists in another repository.

Maven - Uploading a Pom File with Artifacts

To upload a pom file and its associated artifacts add all the files into the upload screen at the same time. Be sure to specify the extension of the pom file as pom; this will let Nexus Repository know it should be taking the coordinates from the pom file, not the UI.

67211166.png

Advanced usage

If you have an advanced use case that isn’t supported by this feature, such as batch uploads or automatically extracting coordinates from a .jar file, look into the component endpoint of our REST and Integration API.