我可以忽略这个关于没有 API KEY 的 nuget 警告吗?

red*_*888 7 artifactory nuget nuget-package

当推动时我看到这个:

nuget push blah.1.0.0.nupkg -source repo
WARNING: No API Key was provided and no API Key could be found for 'https://meeee.jfrog.io/meeee/api/nuget/repo'. To save an API Key for a source use the 'setApiKey' command.
Pushing blah.1.0.0.nupkg to 'https://meeee.jfrog.io/meeeee/api/nuget/repo'...
  PUT https://meeee.jfrog.io/meeee/api/nuget/repo/
  Created https://meeee.jfrog.io/meeee/api/nuget/repo/ 8585ms
Run Code Online (Sandbox Code Playgroud)

仍然有效,并且它必须使用 API 密钥,否则我的访问会被拒绝 - 所以我不确定它警告我什么。也许是因为我没有默认的机器范围 API 密钥?我必须添加包含用户名和密码的 nuget 源,因为 nuget 很混乱,如果不为每个源设置默认 API 密钥,则不会为其提取默认 API 密钥。

我还注意到,即使我连续多次上传相同的包,它仍然会上传它 - 我想也许 Artifactory 会看到它是相同的,而不上传或告诉我?

Sim*_*tes 3

您的nuget.config文件中可能已指定用于repo进行身份验证的凭据。

要消除警告,只需在请求中使用 --api-key 0 指定一个虚拟 API 密钥即可。

编辑 2023-09-13:通过最近的更新,这似乎不再像 @Petter Hesselberg 所说的那样工作