微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

build.sbt如何解析为AWS Codeartifact存储库? 〜/ .sbt / 0.13 / plugins / credentials.sbt 〜/ .sbt / .credentials ./ build.sbt

如何解决build.sbt如何解析为AWS Codeartifact存储库? 〜/ .sbt / 0.13 / plugins / credentials.sbt 〜/ .sbt / .credentials ./ build.sbt

我们最近移到了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

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。