为了统一镜像源,我在打包机器上的~/.bash_profile
文件添加了如下代码
export PUB_HOSTED_URL=https://pub.flutter-io.cn
export FLUTTER_STORAGE_BASE_URL=https://storage.flutter-io.cn
并且通过flutter pub get
验证无误。但是通过Jenkins打包时执行flutter pub get
还是跑到https://pub.dartlang.org
去下载依赖库。
解决办法:
在Jenkins Shell命令里,执行flutter pub get
之前添加导出操作
export PUB_HOSTED_URL=https://pub.flutter-io.cn
export FLUTTER_STORAGE_BASE_URL=https://storage.flutter-io.cn
flutter pub get