SBT 使用的默认存储库是什么? [英] What are the default repositories that SBT uses?
问题描述
我可以提供一个 ~/.sbt/repositories
文件来覆盖 SBT 用于解析依赖项的存储库.当文件存在时,不使用默认存储库.
I can provide a ~/.sbt/repositories
file to override the repositories that SBT uses for resolving dependencies. When the file is present the default repositories aren't used.
SBT (0.13) 中的默认存储库是什么?我想将它们添加到我的存储库文件中,这样我就可以解决网络内外的依赖关系,而无需更改/移动文件.
What are the default repositories in SBT (0.13)? I want to add them to my repositories file so I can resolve dependencies inside and outside the network without having to change/move the file.
推荐答案
如果您想添加到默认存储库(而不是替换它们),我认为最简单的方法是创建一个 <~/sbt/0.13/
中的code>.sbt文件,例如~/sbt/0.13/my-resolvers.sbt
:
If you want to add to the default repositories (instead of replacing them), I think the easiest would be to create an .sbt
file inside ~/sbt/0.13/
, e.g. ~/sbt/0.13/my-resolvers.sbt
:
resolvers += "Oracle Repository" at "http://download.oracle.com/maven"
否则,您可以通过 show externalResolvers
在 sbt 控制台中找到.条目存储在 sbt.boot.properties,最终作为启动器 jar 中的 sbt/sbt.boot.properties
文件(例如 ~/.sbt/launchers/0.13.17/sbt-launch.jar
):
Otherwise, you can find out in the sbt console via show externalResolvers
. The entries are stored in sbt.boot.properties, which ends up as the sbt/sbt.boot.properties
file in the launcher jar (for example ~/.sbt/launchers/0.13.17/sbt-launch.jar
):
[repositories]
local
local-preloaded-ivy: file:///${sbt.preloaded-${sbt.global.base-${user.home}/.sbt}/preloaded/}, [organization]/[module]/[revision]/[type]s/[artifact](-[classifier]).[ext]
local-preloaded: file:///${sbt.preloaded-${sbt.global.base-${user.home}/.sbt}/preloaded/}
maven-central
typesafe-ivy-releases: https://repo.typesafe.com/typesafe/ivy-releases/, [organization]/[module]/[revision]/[type]s/[artifact](-[classifier]).[ext], bootOnly
sbt-ivy-snapshots: https://repo.scala-sbt.org/scalasbt/ivy-snapshots/, [organization]/[module]/[revision]/[type]s/[artifact](-[classifier]).[ext], bootOnly
这篇关于SBT 使用的默认存储库是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!