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 Manager 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:
- The nx-component-upload privilege assigned to the user (anonymous users do not have this privilege by default, but admins do)
- One or more hosted repositories (only formats listed in the table below are supported)
- 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.
- 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|
|Maven (release only)||No restrictions, but common types include ||Yes|
None with permissive policy, otherwise
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, which will display the screen shown below.
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, as seen here:
If you click 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. This is demonstrated here:
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 Repo know it should be taking the coordinates from the pom file, not the UI.
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.