Create a NuGet Repository

Create a NuGet Repository

To install (or publish) NuGet packages, creation of a NuGet repository is required. Check out Nexus Repository Management and Repository Types to learn more.

NuGet Proxy Repository

Use Nexus proxy repository when you want to download packages and centralize package caching of external dependencies. To learn more, check Proxy Repositories.

To create a new Swift proxy repository, take the following steps:

  1. Navigate to SettingsRepositoryRepositories.
  2. Select the Create repository button.
  3. From the list of Recipes, select nuget (proxy).
  4. In the form that appears, complete the required fields.
  5. Enter the Symbol Server URL to proxy Symbol downloads. Requests to /symbols/{filename}/{hash}/{filename} that miss the local cache are forwarded to this URL and the response is cached locally for subsequent requests.
  6. Select the Allow Anonymous Symbol Access checkbox (enabled by default) to bypass the standard authentication check. This is a required field for most .NET debuggers as they do not send authentication headers on symbol requests. Uncheck this only if you have arranged for your clients to authenticate to the SymSrv endpoint.
  7. Complete the additional fields for configurations you wish to add for creating your repository. Available configurations differ by repository format and type. See Configurable Repository Fields and Format Specific Configurations for more details.
  8. Select Create repository.

Note

The repository protocol must be compatible with the upstream feed. Chocolatey Community Repository uses a NuGet v2 endpoint.

NuGet Hosted Repository

Use Nexus hosted repository when you want to publish and store your own internal artifacts and third party components, so they can be consumed via Nexus. To learn more, check Hosted Repositories.

To create a new NuGet hosted repository, take the following steps:

  1. Navigate to SettingsRepositoryRepositories.
  2. Select the Create repository button.
  3. From the list of Recipes, select nuget (hosted).
  4. In the form that appears, complete the required fields.
    • Repository Name, for example nuget-hosted
    • Blob store
  5. Complete the additional fields for configurations you wish to add for creating your repository. Available configurations differ by repository format and type. See Configurable Repository Fields for more details.
  6. Select Create repository.

NuGet Group Repository

Use Nexus group repository when you want to combine multiple other repositories (proxy, hosted, and other groups) and expose them through a single URL. To learn more, check Group Repositories.

To create a new NuGet group repository, take the following steps:

  1. Navigate to SettingsRepositoryRepositories.
  2. Select the Create repository button.
  3. From the list of Recipes, select nuget (group).
  4. In the form that appears, complete the required fields.
    • Repository Name, for example nuget-group
    • Blob store
    • Member repositories in the desired order
  5. Complete the additional fields for configurations you wish to add for creating your repository. Available configurations differ by repository format and type. See Configurable Repository Fields for more details.
  6. Select Create repository.

Best Practices

Migrate NuGet v2 to NuGet v3 Repositories

NuGet.org had updated its package service to version 3 to provide performance improvements over its legacy version 2 (OData-based) service. Nexus Repository continues to provide limited support for the V2 endpoint, though it is not recommended.

To retain packages from your version 2 proxy repository, use the Export and Import tasks to move them to a hosted repository.

No migration is needed for hosted repositories. NuGet-hosted repositories support both NuGet v2 and v3 protocols.

For NuGet group repositories, create a new NuGet 3 group repository and include only V3 proxy repositories.