sbt - 如何使用内部 Nexus 存储库配置 SBT?

标签 sbt

我无法通过我当前的网络访问像 repo1.maven.org 这样的外部主机。不过,我有一个内部 Nexus 存储库。如何设置 SBT 以使用该存储库?

我得到的示例错误:

C:\Users\myusername>sbt sbt-version
Getting net.java.dev.jna jna 3.2.3 ...
You probably access the destination server through a proxy server that is not well configured.
You probably access the destination server through a proxy server that is not well configured.
You probably access the destination server through a proxy server that is not well configured.

: problems summary ::
::: WARNINGS
   Host repo.typesafe.com not found. url=http://repo.typesafe.com/typesafe/ivy-releases/net.java.dev.jna/jna/3.2.3/ivys/ivy.xml

   Host repo1.maven.org not found. url=http://repo1.maven.org/maven2/net/java/dev/jna/jna/3.2.3/jna-3.2.3.pom

   Host oss.sonatype.org not found. url=https://oss.sonatype.org/content/repositories/snapshots/net/java/dev/jna/jna/3.2.3/jna-3.2.3.pom

           module not found: net.java.dev.jna#jna;3.2.3

   ==== local: tried

     \\NLON11P20106A\wbulaty1$\.ivy2\local\net.java.dev.jna\jna\3.2.3\ivys\ivy.xml

   ==== typesafe-ivy-releases: tried

     http://repo.typesafe.com/typesafe/ivy-releases/net.java.dev.jna/jna/3.2.3/ivys/ivy.xml

   ==== Maven Central: tried

     http://repo1.maven.org/maven2/net/java/dev/jna/jna/3.2.3/jna-3.2.3.pom

   ==== sonatype-snapshots: tried

     https://oss.sonatype.org/content/repositories/snapshots/net/java/dev/jna/jna/3.2.3/jna-3.2.3.pom

           ::::::::::::::::::::::::::::::::::::::::::::::

           ::          UNRESOLVED DEPENDENCIES         ::

           ::::::::::::::::::::::::::::::::::::::::::::::

           :: net.java.dev.jna#jna;3.2.3: not found

           ::::::::::::::::::::::::::::::::::::::::::::::

最佳答案

我自己没有尝试过,但据说 Global repository setting当前 sbt 0.12 中的功能是为这种情况创建的:

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.

关于sbt - 如何使用内部 Nexus 存储库配置 SBT?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18397568/

相关文章:

scala - 是否可以在 sbt 中显示所有键的值?

jenkins - 我在构建 sbt jenkins 管道项目时在 jenkins 控制台中得到 [0m[[0m[0minfo[0m] [0m[0m]

scala - 在 scala 项目中 - 运行 sbt test 命令时出现错误 GC 开销限制超出

scala - 如何在不使用鼠标的情况下将插入符号移动到 sbt shell?

sbt - 以编程方式使用 sbt 解决工件

scala - 为什么Scala和sbt可以编译这段代码?

scala - 玩! - 从 SBT 控制台与 webapp 交互

scala - Build.scala :1: not found: object sbt

scala - 无法在 SBT 中运行 Apache Spark 相关单元测试 - NoClassDefFoundError

scala - 无法使用 scala 的 sbt 从存储库中获取插件