Preambule:
I would like to setup a NuGet repository hosted inside of my company.
We already had a Nexus OSS 2.13 running so I tried setting up a Nuget hosted repository on it, and uploaded my package there to test it. I then configured NuGet repos on my Visual Studio 2015 in order to add the one on that nexus server.
The problem I encountered then is that VS2015 uses (apparently) nuget feed v3, while Nexus 2.13 has the v2 feed. The symptom was a 404 error while browsing the nexus repository (when nuget calls repo_url/Search()
).
The error message looked like :
The v2 feed at '/nexus nuget repository url/Search()?[...]' returned '404 not found'
Browsing it through the repo url in a web browser (without /Search()
) works fine, and so is browsing repo_url/FindPackagesById
.
I tried downgrading my NuGet vsix version as much as possible, going down to v3.1.1
, but no version worked with the v2 feed.
What I tried next:
I looked up Sonatype website about nexus, and saw Nexus v3 is said to handle NuGet, while v2 has no such mention. I decided to try and install Nexus 3 next to our Nexus 2.13 (on the same machine) and see what it had to offer.
I downloaded v3.0.2-02
from that same page as above and started setting it up.
I followed parts of the documentation on how to install it skipping some parts that were already done because of the v2.13
installation. (Disclaimer: I did not install v2.13
myself though I considered installing java runtime environment and stuff like that to be a given).
I then started nexus 3 as a service and successfully reached the home page and logged in as admin.
Having read a statement on hosted repository management in the documentation saying:
By default, the repository manager ships with the following configured hosted repositories:
[...]
nuget-hosted
This hosted repository is where your organization can publish internal
releases in repository using the NuGet repository format. You can also
use this repository for third-party components that are not available in
external repositories, that could potentially be proxied to gain access
to the components.
I headed to Repository -> Repositories
section and clicked "Create repository".
Only maven (group/hosted/proxy) and raw (group/hosted/proxy) recipes are available. No Nuget, no npm, nothing else than maven...
Searching a bit, I found in the System -> Bundles
section that the bundle for nuget repositories mvn:com.sonatype.nexus.plugins/nexus-repository-nuget/3.0.2-02
is listed as Installed
while maven's mvn:org.sonatype.nexus.plugins/nexus-repository-maven/3.0.2-02
is listed as Active
.
I tried looking for a place where bundles can be activated, and thought I found one at $NEXUS_HOME/etc/startup.properties
where the first line says:
# Bundles to be started on startup, with startlevel
and contains line looking the one I added to try and activate nuget:
mvn\:com.sonatype.nexus.plugins/nexus-repository-nuget/3.0.2-02 = 10
I then used > sudo service nexus3 restart
to restart nexus v3, logged back into admin, went to Repositories, and saw that still no nuget recipe is available.
I went back to Bundles and saw the nuget bundle is still listed as Installed
and not Active
.
I'm now all out of ideas as to what I could or should do in order to simply create a hosted nuget repository, which should already be available according to nexus' documentation...
What am I missing?
What is wrong with a fresh install missing what the documentation is saying is available by default?
How do I create a hosted NuGet repository on that nexus v3?