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完成设置。
本文指导如何修改IntelliJ IDEA中sbt的默认仓库路径。通过编辑sbtconfig.txt和repo.properties文件,可以将sbt的boot目录、全局基目录、Ivy缓存目录及仓库配置设置为指定位置,例如D:/Users/zbs相关目录。同时,repo.properties文件列举了多个仓库地址,包括本地、阿里云等,以实现灵活的依赖管理。
956

被折叠的 条评论
为什么被折叠?



