我无法通过当前网络访问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
::::::::::::::::::::::::::::::::::::::::::::::
答案 0 :(得分:0)
我自己没有尝试过,但据说当前sbt 0.12的Global repository setting功能是为这种情况创建的:
通过在
[repositories]
中放置一个独立的~/.sbt/repositories
部分(请参阅Launcher Specification页面)并将-Dsbt.override.build.repos=true
传递给sbt来定义要使用的存储库。启动程序将仅使用该文件中的存储库来检索sbt和Scala,并在检索项目依赖项时使用sbt。