scala - 如何强制通过 Nexus 下载 SBT 插件和插件?

标签 scala sbt

我认为现在我想出了如何强制通过 Nexus 下载项目依赖项。 (我通过将 externalResolvers 显式设置为 Seq 来做到这一点,只有一个值:

override lazy val settings = super.settings ++ Seq(
  externalResolvers := Seq("Nexus repository" at "http://.../nexus/content/groups/public/")
)

但是,如果我删除了 Ivy 缓存,SBT 仍然会访问许多公共(public)存储库来获取插件。理想情况下,我也希望通过 Nexus 来确保我们不会依赖这些存储库永远存在。 (他们没有。)

有什么线索吗? (我在 SBT 0.11.2 上)

最佳答案

添加 sbt 0.12 Global repository setting以此目的。

Define the repositories to use by putting a standalone [repositories] section (see the Launcher Specification page) in ~/.sbt/repositories and pass -Dsbt.override.build.repos=true to sbt. Only the repositories in that file will be used by the launcher for retrieving sbt and Scala and by sbt when retrieving project dependencies.

关于scala - 如何强制通过 Nexus 下载 SBT 插件和插件?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9885605/

相关文章:

scala - 使用函数式回调/代理模式实现 scala 进行缓存

scala - 高效的 Scala 惯用方法来选择前 85% 的排序值?

scala - 为 Scala 中的代码块提供隐式函数

macos - sbt 损坏终端显示

scala - 惯用的 Scala : Semantic difference between <Collection>Like and <Collection> Types?

scala - 如何使用特定格式的 nscala-time 解析字符串

scala - 使用 sbt-assembly 的 assembly-merge-strategy 问题

java - 在 Play Framework 2.3.0 (Java) 的 build.sbt 中定义 JAVA_OPTS

docker - SBT 未从根目录运行

scala - SBT 在 Build.scala 中指定 java 堆大小