问题描述
我们最近移到了AWS Codeartifact存储库。我们很少需要构建基于SBT的项目。
这是我的全局设置:
〜/ .sbt / 0.13 / plugins / credentials.sbt
credentials += Credentials(Path.userHome / ".sbt" / ".credentials")
〜/ .sbt / .credentials
realm=Sonatype Nexus Repository Manager
host=somedomain-1234567890.d.codeartifact.ap-southeast-1.amazonaws.com
user=aws
password=xxxxxxxxxxxxxxxxxx
其中password
来自下面的CODEARTIFACT_AUTH_TOKEN
:
export CODEARTIFACT_AUTH_TOKEN=`aws codeartifact get-authorization-token --domain somedomain --domain-owner 1234567890 --query authorizationToken --output text`
在项目级别,我有
./ build.sbt
...
resolvers := Seq(
...
"Private Nexus" at "https://somedomain-1234567890.d.codeartifact.ap-southeast-1.amazonaws.com/maven/superone-snapshots",...
)
...
无论何时sbt compile
我仍然得到:
[error] Unable to find credentials for [somedomain/superone-snapshots @ somedomain-1234567890.d.codeartifact.ap-southeast-1.amazonaws.com].
[error] Is one of these realms misspelled for host [somedomain-1234567890.d.codeartifact.ap-southeast-1.amazonaws.com]:
[error] * Sonatype Nexus Repository Manager
有人成功获得build.sbt解析为AWS CodeArtificat吗?
谢谢。
解决方法
您的存储库领域是somedomain/superone-snapshots
,您必须在〜/ .sbt / .credentials文件中将该字符串指定为领域。
参见https://www.scala-sbt.org/1.x/docs/Publishing.html#Credentials