5

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

           ::::::::::::::::::::::::::::::::::::::::::::::
4

1 回答 1

0

I haven't tried this myself but supposedly Global repository setting feature in current sbt 0.12 was created for that kind of situation:

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.

于 2013-08-23T16:30:07.610 回答