This is driving me nuts. I have installed Nexus 3 OSS to use as a private NuGet-repository and created a user foe jenkins. I got an ApiKey for the jenkins user the way the documentation shows and now I try to push my packages to the repo with
nuget push .\AMAP.*.symbols.nupkg -Source http://nexus.local:8081/repository/nuget-hosted/ -ApiKey <JenkinsApiKeyHere>
But if I do this I am asked for username and password. I tried to set username and password to my configuration as suggested by some sources found on the net like this:
nuget sources update -Name my-nuget -username jenkins -password <supersecretjenkinspwd>
But still I am asked for username and password!? By the way, the anonymous access to nexus is granted as shown in the sonatype docs.
As you can see from above I am trying to do this from a jenkins build server and I already tried the nexus artifact uploader plugin without success. It fails with a NullPointer:
java.lang.NullPointerException
at sp.sd.nexusartifactuploader.steps.NexusArtifactUploaderStep.getUsername(NexusArtifactUploaderStep.java:132)
So I think it has the same problem. How can I achieve to push my NuGet-packages to Nexus without user interaction?
Ok, I found the solution myself. I needed to add the NuGet API-Key Realm to the active realms. By default it is not active thus preventing the ApiKey from being considered as valid credential. This is done under Settings -> Security -> Realms.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With