sbt默认源很慢,推荐使用国内源。但国内源也有缺点,最新的版本,可能是没有的。
1,配置源地址
$ cat ~/.sbt/repositories
[repositories]
local
aliyun: http://maven.aliyun.com/nexus/content/groups/public
typesafe-ivy-releases: http://repo.typesafe.com/typesafe/ivy-releases/, [organization]/[module]/[revision]/[type]s/[artifact](-[classifier]).[ext], bootOnly
sonatype-oss-releases
maven-central
sonatype-oss-snapshots
2,VM parameters添加以下内容
-Dsbt.override.build.repos=true
-Dsbt.repository.config=/Users/zhangying/.sbt/repositories
-Dsbt.boot.directory=/Users/zhangying/.sbt/boot
-Dsbt.global.base=/Users/zhangying/.sbt/
-Dsbt.ivy.home=/Users/zhangying/.ivy2
如下:
sbt 换源配置
3,测试
sbt 换源成功