我正在尝试从我的私人仓库中获取一些依赖项,但似乎sbt无法找到凭据。每当我尝试获取依赖项时,终端中也会出现错误
[error] Unable to find credentials for [Artifactory Realm @ artifactory.mydomain.com].
我已经阅读了几个答案,但没有一个能为我工作。 到目前为止我做了什么:
1)我配置了我的仓库
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)我导出了env变量SBT_CREDENTIALS
export SBT_CREDENTIALS=/Users/myuser/.sbt/.credentials
4)我在〜/ .sbt / 0.13 /凭证以及〜/ .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?
答案 0 :(得分:1)
我将credentials.sbt复制到了〜/ .sbt / 1.0,因为我找到了这个答案: Where should the SBT credentials configuration go?看起来就像是诀窍。