1
2
3
-Dsbt.global.base=/home/sbt/.sbt
-Dsbt.ivy.home=/home/ivy/
-Dsbt.repository.config=D:/JavaDev/sbt/conf/repo.properties

修改 sbt 基础目录

方法一:在 conf/sbtconfig.txt 添加参数 -Dsbt.global.base=/home/sbt/.sbt
方法二:设置启动 sbt-launch.jar 的启动参数,在 idea 中使用 sbt 需要使用这种方式
在 idea 的 sbt 中,JVM Options > VM parammeter 中添加参数 -Dsbt.global.base=/home/sbt/.sbt

修改ivy本地仓库位置

方法同上,参数为 -Dsbt.ivy.home=/home/ivy/

远程仓库配置

sbtconfig.txt 或 JVM 参数中配置 -Dsbt.repository.config=D:/JavaDev/sbt/conf/repo.properties
repo.properties 文件配置

1
2
3
4
5
[repositories]
local
maven-local: file://E:/Dev/Java/MavenRepo
nexus: http://maven.aliyun.com/nexus/content/groups/public/
typesafe: http://repo.typesafe.com/typesafe/ivy-releases/, [organization]/[module]/(scala_[scalaVersion]/)(sbt_[sbtVersion]/)[revision]/[type]s/[artifact](-[classifier]).[ext], bootOnly

设置代理

export JAVA_OPTS="$JAVA_OPTS -Dhttp.proxyHost=yourserver -Dhttp.proxyPort=8080 -Dhttps.proxyHost=yourserver -Dhttps:porxyPort=8080 -Dhttp.proxyUser=username -Dhttp.proxyPassword=password"

How to use sbt from behind proxy?

参考文章:
Idea使用系统自带的sbt,并自定义repositories