sbt換源


sbt換源

兩種方法不一定都能用

方法一

Linux系統,則進入Bash執行如下命令:

cd  ~
mkdir  .sbt
cd  .sbt

然后創建 repositories 文件內容如下,並將文件拷貝到 .sbt 目錄下

[repositories]
local
huaweicloud-maven: https://repo.huaweicloud.com/repository/maven/
maven-central: https://repo1.maven.org/maven2/
sbt-plugin-repo: https://repo.scala-sbt.org/scalasbt/sbt-plugin-releases, [organization]/[module]/(scala_[scalaVersion]/)(sbt_[sbtVersion]/)[revision]/[type]s/[artifact](-[classifier]).[ext]

打開 sbt-1.3.0/conf/sbtopts 文件(不同機器位置不同,請自行尋找),在末尾新增一行,內容如下:

-Dsbt.override.build.repos=true

方法二

下載sbt-launch.jar包

wget http://maven.aliyun.com/nexus/content/repositories/central/org/scala-sbt/sbt-launch/1.3.10/sbt-launch-1.3.10.jar

解壓並對其中的./sbt/sbt.boot.properties文件進行修改,在[repositories]處改為以下內容,增添一條阿里雲鏡像

unzip -q ./sbt-launch.jar
vim ./sbt/sbt.boot.properties
 
[repositories]
  local
  aliyun: http://maven.aliyun.com/nexus/content/groups/public/
  central: http://repo1.maven.org/maven2/

重新打包

jar -cfM ./sbt-launch.jar . #在主目錄下進行

檢驗sbt是否可用

./sbt version


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM