简体   繁体   English

如何在仍然引用pub.dartlang.org的包时运行私有pub服务器?

[英]How do I run a private pub server while still referencing packages from pub.dartlang.org?

Assuming that I'm running my own instance of pub-dartlang for a private pub feed; 假设我正在运行我自己的pub-dartlang实例,用于私人酒吧订阅源; how do I indicate in pubspec.yaml which packages come from the private feed vs pub.dartlang.org? 我如何在pubspec.yamlpubspec.yaml哪些软件包来自私有feed vs pub.dartlang.org?

You can set the environment variable PUB_HOSTED_URL so it points to your custom pub repo server. 您可以设置环境变量PUB_HOSTED_URL ,使其指向您的自定义pub repo服务器。 This way pub loads all packages which don't have a server specified from this server. 这样pub加载所有没有从该服务器指定的服务器的软件包。

You can define exceptions in pubspec.yaml like 您可以在pubspec.yaml定义异常

dependencies:
  transmogrify:
    hosted:
      name: transmogrify
      url: http://some-package-server.com

see https://www.dartlang.org/tools/pub/dependencies.html for more details. 有关详细信息,请参阅https://www.dartlang.org/tools/pub/dependencies.html

There is another package that seems to provide a custom Pub repo https://pub.dartlang.org/packages/pub_proxy_server 还有另一个包似乎提供了一个自定义的Pub repo https://pub.dartlang.org/packages/pub_proxy_server

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 我如何确定pub.dartlang.org上弃用了Google Dart Team的某些软件包? - How I can determine that some packages from Google Dart Team deprecated on pub.dartlang.org? 如何估计pub.dartlang.org包的质量? - How to estimate the quality of pub.dartlang.org packages? Flutter 调试 /root/.pub-cache/hosted/pub.dartlang.org 包中的编译错误 - Flutter debug compilation error from /root/.pub-cache/hosted/pub.dartlang.org packages Dart和http://pub.dartlang.org/packages/route - Dart and http://pub.dartlang.org/packages/route 在 pub.dartlang.org 上发布的包的下载统计信息? - Download statistics for packages published on pub.dartlang.org? 将 dart 库转移到 pub.dartlang.org 中的另一个所有者 - Transferring a dart library to another owner in pub.dartlang.org 我需要在使用Dart包之前将其发布到pub.dartlang.org吗? - Am I required to publish my Dart package to pub.dartlang.org before I use it? 尝试在 https://pub.dartlang.org 上查找包 cupertino_icons 时出现 TLS 错误 - Got TLS error trying to find package cupertino_icons at https://pub.dartlang.org 连接失败,地址 = pub.dartlang.org,端口 = 443 flutter visual studio Mac big sur - Connection failed, address = pub.dartlang.org, port = 443 flutter visual studio Mac big sur 尝试在 https://pub.dartlang.org 上查找包 english_words 时出现套接字错误 - Got socket error trying to find package english_words at https://pub.dartlang.org
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM