1. 程式人生 > >idea sbt 修改預設倉庫,想放哪放哪。

idea sbt 修改預設倉庫,想放哪放哪。

1.開啟本地的sbt目錄的conf


2.在sbtconfig.txt 配置檔案末尾新增如下程式碼:

  涉及到的路徑修改為自己的路徑。

-Dsbt.boot.directory=D:/Users/zbs/.sbt/boot

-Dsbt.global.base=D:/Users/zbs/.sbt

-Dsbt.ivy.home=D:/Users/zbs/.ivy2

-Dsbt.repository.config=D:\sbt\conf\repo.properties

4. repo.properties 檔案內容:
----------------------------------------------------------------------------
[repositories]
  local
  comp-maven:http://mvnrepository.com/artifact/
  store_cn:http://maven.aliyun.com/nexus/content/groups/public/
  store_mir:http://mirrors.ibiblio.org/maven2/
  store_0:http://maven.net.cn/content/groups/public/
  store_1:http://repo.typesafe.com/typesafe/ivy-releases/
  store_2:http://repo2.maven.org/maven2/
  sbt-releases-repo: http://repo.typesafe.com/typesafe/ivy-releases/, [organization]/[module]/(scala_[scalaVersion]/)(sbt_[sbtVersion]/)[revision]/[type]s/[artifact](-[classifier]).[ext]
  sbt-plugins-repo: http://repo.scala-sbt.org/scalasbt/sbt-plugin-releases/, [organization]/[module]/(scala_[scalaVersion]/)(sbt_[sbtVersion]/)[revision]/[type]s/[artifact](-[classifier]).[ext]

  maven-central: http://repo1.maven.org/maven2/

-------------------------------------------------------------------------------------------------

5.開啟idea.



6.在2的位置寫上自己想存放的目錄。

-Dsbt.boot.directory=D:/Users/zbs/.sbt/boot

-Dsbt.global.base=D:/Users/zbs/.sbt

-Dsbt.ivy.home=D:/Users/zbs/.ivy2

-Dsbt.repository.config=D:\sbt\conf\repo.properties

7.點選ok完成設定。