【问题标题】:How do I configure SBT with an internal Nexus repository?如何使用内部 Nexus 存储库配置 SBT?
【发布时间】:2013-08-26 04:40:05
【问题描述】:

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

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

【问题讨论】:

标签: sbt


【解决方案1】:

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

通过在~/.sbt/repositories 中放置一个独立的[repositories] 部分(参见Launcher Specification 页面)来定义要使用的存储库,并将-Dsbt.override.build.repos=true 传递给sbt。只有该文件中的存储库将被启动器用于检索 sbt 和 Scala,以及在检索项目依赖项时被 sbt 使用。

【讨论】:

    猜你喜欢
    • 2021-09-05
    • 2017-12-21
    • 1970-01-01
    • 2011-04-15
    • 2011-04-13
    • 1970-01-01
    • 2020-06-07
    • 2023-03-13
    • 1970-01-01
    相关资源
    最近更新 更多