You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

能否控制Artifactory中本地仓库顺序?NuGet重复包返回规则咨询

NuGet Package Resolution in Artifactory Virtual Repositories

Great question! Let me break down exactly how this works based on hands-on experience with Artifactory and NuGet:

What happens when duplicate packages exist in local repositories?

  • When two local repositories in your virtual repo contain identical NuGet packages (same ID and exact version), Artifactory follows a strict priority rule for resolution. During nuget restore or direct package pulls, the client will receive the package from the highest-priority local repository in your virtual repo's configuration.
  • Important callout: This only applies to packages with matching IDs and versions. If versions differ, Artifactory will return all available versions (sorted by NuGet's standard versioning rules) regardless of repository order.

Does reordering local repositories affect which package is returned?

  • Absolutely! The drag-and-drop order you set in the Artifactory UI for local repositories within the virtual repo directly defines their priority. When duplicate same-version packages exist, Artifactory will only return the package from the repository that appears first (topmost) in the list.
  • As a side note: By default, remote/cache repositories (like your public NuGet cache) have lower priority than local repositories. So if a local repo has the package, Artifactory will never fall back to the cache for that specific package version.

Quick verification tip

You can test this behavior directly with the NuGet CLI to confirm which package Artifactory resolves to:

nuget list <Your-Package-Id> -Source <Your-Virtual-Repo-URL>

The output will show the package from the highest-priority repository, matching the order you set in the UI.

内容的提问来源于stack exchange,提问作者red888

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.29 09:03:00