我无法通过我当前的网络访问像 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/