idea sbt 修改默认仓库,想放哪放哪。

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

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

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完成设置。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值