【发布时间】:2018-06-03 04:31:17
【问题描述】:
我正在使用 sbt-native-packager 构建一个 rpm,然后我们通过 Nexus 将其存储到 maven2 托管的 repo 中。这在 Nexus 2 中效果很好,但是一旦我们转移到 Nexus 3,它就不再接受 rpm 进入 repo。它可以接受 jar、sources-jar、sources-javadoc 和 pom,但是当涉及到 rpm 时,它会给出 502 Bad Gateway 错误(我相信这意味着它不符合 maven 类型?)
java.io.IOException:对 URL http://nexus.snip.com/repository/releases/com/snip/email-dispatcher-consumer/1.0.17/email-dispatcher-consumer-1.0.17.rpm 的 PUT 操作失败,状态码为 502:网关错误
两个问题:
1) 有没有办法告诉 Rpm 中的 publishTo 发布到不同的关系端点?也许是原始托管回购?我尝试了以下方法:
publishTo in Rpm := {
val nexus = "http://nexus.snip.com/"
Some("releases" at nexus + "repository/rpm-build-storage")
}
但这并没有达到预期的效果。
2) 有没有办法像我们在 Nexus 2 中那样将 rpm 推送到现有的 repo 中?
我们使用 sbt-release 并在发布过程中添加了以下发布步骤,这在 Nexus 2 上运行良好
val publishRPM = ReleaseStep(action = st => {
val extr: Extracted = Project.extract(st)
val ref: ProjectRef = extr.get(thisProjectRef)
extr.runAggregated(
publish in Rpm in ref,
st
)
st
})
【问题讨论】: