【发布时间】:2018-12-20 01:21:33
【问题描述】:
我正在我们的构建服务器(bamboo)上为多个构建代理设置 SBT。为此,我为每个代理创建了一个单独的目录,其中包含特定于代理的配置和 .ivy 主目录,以确保完全填充代理隔离。 构建本身是这样调用的:
/sbt-launcher-packaging-0.13.13/bin/sbt -java-home /usr/lib/jvm/jdk1.7.0_79 -Dsbt.override.build.repos=true -Dsbt.repository.config=/data/bamboo/localbuildagents/${bamboo.agentId}/sbt/sbt.conf -Dsbt.ivy.home=/data/bamboo/localbuildagents/${bamboo.agentId}/.ivy2 clean compile dist
凭据(基本领域)存储在启动竹服务器的用户主目录下(~/.sbt/.credentials 和 ~/.sbt/0.13/plugins/credentials.sbt)
每个 sbt.conf 都包含特定于代理的 repos,例如特定于代理的本地 maven repo 和远程工件的 url。
[repositories]
local-buildagent-mvn: file:///data/bamboo/home/.m2/AGENT-xxxxxxxx/repository/
ivy-release: http://xxx/artifactory/ivy-release/, [organization]/[module]/(scala_[scalaVersion]/)(sbt_[sbtVersion]/)[revision]/[type]s/[artifact](-[classifier]).[ext]
mvn-release: http://xxx/artifactory/libs-release/
mvn-snapshot: http://xxx/artifactory/libs-snapshot/
[ivy]
ivy-home: file:///data/bamboo/localbuildagents/xxxxxxxx/.ivy2/
我在 sbt 检查远程工件存储库时遇到登录问题(首先是 http 错误 401,然后是令人惊讶的 403)。具有相同凭据和 repo url 的 curl 按预期工作(先是 401,然后是 200)。
我猜,如果 -D 开关用于 sbt 启动,则不考虑凭据。我真的卡住了任何建议,热烈欢迎......
【问题讨论】: