1

我们最近移至 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?

谢谢。

4

1 回答 1

1

您的存储库的领域是somedomain/superone-snapshots,您必须将该字符串指定为 ~/.sbt/.credentials 文件中的领域。请参阅https://www.scala-sbt.org/1.x/docs/Publishing.html#Credentials

于 2020-10-11T08:34:27.020 回答