【问题标题】:sbt not able to connect to private artifactory repositorysbt 无法连接到私有工件存储库
【发布时间】:2018-10-13 13:11:07
【问题描述】:

我正在尝试从我的私人仓库中获取一些依赖项,但是似乎 sbt 无法找到凭据。每当我尝试获取依赖项时,我的终端中也会出现错误

[error] Unable to find credentials for [Artifactory Realm @ artifactory.mydomain.com].

我已经阅读了几个答案,但没有一个对我有用。 到目前为止我做了什么:

1) 我配置了我的 repo

cat ~/.sbt/repositories 
[repositories]
    local
    my-ivy-proxy-releases: https://artifactory.mydomain.com/my-ivy-release-local/, [organization]/[module]/(scala_[scalaVersion]/)(sbt_[sbtVersion]/)[revision]/[type]s/[artifact](-[classifier]).[ext]
    my-maven-proxy-releases: https://artifactory.mydomain.com/my-ivy-release-local/

2) 我创建了一个 .credentials 文件

cat ~/.sbt/.credentials 
realm=Artifactory Realm
host=artifactory.mydomain.com
user=myuser
password=mypassword

3) 我导出了环境变量 SBT_CREDENTIALS

export SBT_CREDENTIALS=/Users/myuser/.sbt/.credentials

4) 我在 ~/.sbt/0.13/credentials 和 ~/.sbt/0.13/plugins/credentials 中创建了 credentials.sbt

cat ~/.sbt/0.13/credentials.sbt 
credentials += Credentials(Path.userHome / ".sbt" / ".credentials") 

当我尝试使用 curl 访问依赖项时,一切正常。

我已经阅读了一些所谓的解决方案,包括:

SBT is unable to find credentials when attempting to download from an Artifactory virtual repo

How to access a secured Nexus with sbt?

How can I provide SBT credentials to my private Artifactory server from a Windows workstation?

【问题讨论】:

  • 尝试将 credentials += Credentials(Path.userHome / ".sbt" / ".credentials"), 放入项目 build.sbt 本身的项目设置中。
  • 没有帮助,我仍然得到同样的错误
  • 我刚刚发现的另一件事是我的凭据已添加,至少 update.log 是这样说的:凭据添加:Artifactory Realm@artifactory.mydomain.com myuser/****** **

标签: scala sbt artifactory


【解决方案1】:

我将 credentials.sbt 复制到 ~/.sbt/1.0 因为我找到了这个答案: Where should the SBT credentials configuration go? 看起来可以解决问题。

【讨论】:

    猜你喜欢
    • 2019-01-01
    • 2014-02-03
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-01-15
    • 1970-01-01
    • 2017-01-14
    • 2023-03-13
    相关资源
    最近更新 更多