scala metals插件(VS Code)、sbt和coursier换国内源
在Chisel的学习过程中发现学习效率受到了网速的限制,国外的maven源几KB/S的速度实在是太影响效率了,所以花了写时间测试得到了相关的换源办法,分别针对VS Code中的scala metals插件、sbt和courier。
-
VS Code中scala metals插件换源
设置里面直接添加自定义仓库:
https://maven.aliyun.com/repository/central
-
sbt换源(很重要)
cd ~ mkdir .sbt cd .sbt
创建repositories文件:
[repositories] local aliyun: https://maven.aliyun.com/repository/central/ sbt-plugin-repo: https://repo.scala-sbt.org/scalasbt/sbt-plugin-releases, [organization]/[module]/(scala_[scalaVersion]/)(sbt_[sbtVersion]/)[revision]/[type]s/[artifact](-[classifier]).[ext]
修改配置文件:
sudo vi /usr/share/sbt/conf/sbtopts
在文件最后添加:
-Dsbt.override.build.repos=true
-
coursier换源(在构建Chisel-bootcamp本地Notebook时使用)
export COURSIER_REPOSITORIES="https://maven.aliyun.com/repository/public|https://maven.scijava.org/content/repositories/public"
以下用于替换安装步骤中的相应部分:
./coursier bootstrap -i user -I user:sh.almond:scala-kernel-api_$SCALA_VERSION:$ALMOND_VERSION sh.almond:scala-kernel_$SCALA_VERSION:$ALMOND_VERSION --sources --default=true -o almond