我已经设置了一个本地NuGet存储库as described here。设置了apikey,并在NuGet.Config文件中设置了身份验证。
要将nupkg直接推入此文件夹,没有问题:
"angular": "1.5.8",
"js-data": "2.9.0",
"js-data-angular": "3.2.1",
"js-data-jsonapi": "0.0.0-alpha.21",
但是一旦我尝试将它推到子文件夹中以便在Artifactory中有一个很好的布局,这就失败了:
nuget push Nuget.0.1.15.nupkg -Source http://arti.url/artifactory/api/nuget/nuget-repo-local
这是一个已知问题,是否有人有解决方案?为每个文件夹创建一个apikey并不是我想要的......
警告如下:
nuget push Nuget.0.1.15.nupkg -Source http://arti.url/artifactory/api/nuget/nuget-repo-local/aFolder
然后错误说:
WARNING: No API Key was provided and no API Key could be found for 'http://arti.url/artifactory/api/nuget/nuget-repo-local/aFolder'.
To save an API Key for a source use the 'setApiKey' command.
答案 0 :(得分:0)
当你这样做时:
nuget push Nuget.0.1.15.nupkg -Source http://arti.url/artifactory/api/nuget/nuget-repo-local/aFolder
nuget将整个url作为repo地址进行解释(客户端实现基于平面部署,其中Artifactory更灵活)
关于在root repo上的部署,我假设你按照指示并首先在repo上运行setApiKey命令:
nuget setapikey <USERNAME>:<PASSWORD> -Source http://arti.url/artifactory/api/nuget/nuget-repo-local
这允许您在不输入凭据的情况下每次推送,但仅限于根级别。
现在,如果您想推送子文件夹,您可以像对rpo本身一样设置apikey:
nuget setapikey <USERNAME>:<PASSWORD> -Source http://arti.url/artifactory/api/nuget/nuget-repo-local/aFolder
但是你必须在每个文件夹
上进行或在推送
上使用“apikey”选项nuget push Nuget.0.1.15.nupkg -Source http://arti.url/artifactory/api/nuget/nuget-repo-local/aFolder -apikey <USERNAME>:<PASSWORD>
或勾选Artifactory中存储库配置中的“强制验证”选项。此选项将强制您输入凭据并防止出现“403”错误。