scala SBT 使用的默认存储库是什么?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/35008617/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-22 07:58:57  来源:igfitidea点击:

What are the default repositories that SBT uses?

scalasbt

提问by Alessandro Vermeulen

I can provide a ~/.sbt/repositoriesfile to override the repositories that SBT uses for resolving dependencies. When the file is present the default repositories aren't used.

我可以提供一个~/.sbt/repositories文件来覆盖 SBT 用于解决依赖关系的存储库。当文件存在时,不使用默认存储库。

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) 中的默认存储库是什么?我想将它们添加到我的存储库文件中,这样我就可以解决网络内外的依赖关系,而无需更改/移动文件。

回答by 0__

If you want to addto the default repositories (instead of replacing them), I think the easiest would be to create an .sbtfile inside ~/sbt/0.13/, e.g. ~/sbt/0.13/my-resolvers.sbt:

如果你想添加到默认存储库(而不是替换它们),我认为最简单的方法是在.sbt里面创建一个文件~/sbt/0.13/,例如~/sbt/0.13/my-resolvers.sbt

resolvers += "Oracle Repository" at "http://download.oracle.com/maven"

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.propertiesfile in the launcher jar (for example ~/.sbt/launchers/0.13.17/sbt-launch.jar):

否则,您可以通过 sbt 控制台找到show externalResolvers。这些条目存储在sbt.boot.properties 中,它最终作为sbt/sbt.boot.properties启动器 jar 中的文件(例如~/.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