1. 使用环境变量COURSIER_CACHE,依据是https://github.com/coursier/coursier/blob/master/doc/docs/cache.md
export COURSIER_CACHE=some/dir
2. 使用java system property,依据是https://github.com/sbt/sbt/blob/v1.3.1/main/src/main/scala/sbt/coursierint/LMCoursier.scala#L40-L44
-Dsbt.coursier.home=some/path
如配置sbtconfig.txt时加入-Dsbt.coursier.home=some/path,或者在idea中做如下配置
我的repo.properties是下面这样配置的,其中uk、aliyun-central, repo1, store_2是重复的,把最快下载速度的url放到最前面去。
[repositories]
local
sbt-plugin: https://repo.scala-sbt.org/scalasbt/sbt-plugin-releases/, [organization]/[module]/(scala_[scalaVersion]/)(sbt_[sbtVersion]/)[revision]/[ty