Skip to main content

Accessing Packages in Repositories and Groups in Nexus Repository 2

Nexus Repository 2

Once you have set up your hosted and proxy repositories for NuGet packages, and potentially created a repository group, you can access them with the nuget tool on the command line. Copy the Package Source URL from the NuGet tab of the repository/group configuration you want to access and add it to nuget on the command line with e.g.:

nuget sources add -name NuGetNexus -source 
http://localhost:8081/nexus/service/local/nuget/nuget-public

Replace localhost with the public hostname or URL of your repository manager and nuget-public with the name of the repository you want to proxy. Ideally, this will be your NuGet group.

After this source was added, you can list the available packages with the command nuget list.

Access to the packages is not restricted by default. If access restrictions are desired, you can configure security directly or via LDAP/Active Directory external role mappings combined with repository targets for fine grained control. Authentication from NuGet is then handled via NuGet API keys as documented in Deploying Packages to NuGet Hosted Repositories.