发布 RPM 到 nexus 3
Publish RPM to nexus 3
我正在使用 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 发布到不同的 nexus 端点?也许是原始托管回购?我尝试了以下方法:
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
})
Is there a way to tell the publishTo in Rpm to publishTo a different nexus endpoint? Perhaps a raw hosted repo?
是的,有。我不得不自己修改一下 sbt。您几乎做对了,但是 sbt/ivy 使用唯一的字符串名称来查找解析器,因此您必须将它们添加到正确的范围内。如果您可以在 sbt-native-packager 上打开一个问题以将其添加到 Deployment
插件中,那就太棒了。
// NOT NECESSARY. This resolver is automagically added to the `otherResolvers` setting.
publishTo := Some(Resolver.file("file-target", target.value / "ivy2" ))
// add your resolver to the `otherResolvers` setting and rpm:publish will find it
otherResolvers += Resolver.file("file-rpm", target.value / "ivy2-rpm")
publishTo in Rpm := Some(Resolver.file("file-rpm", target.value / "ivy2-rpm"))
Is there a way to push the rpm into the existing repo like we did in Nexus 2?
我不知道:(
希望第一个回答对您有所帮助:)
干杯,新年快乐,
向
我正在使用 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 发布到不同的 nexus 端点?也许是原始托管回购?我尝试了以下方法:
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
})
Is there a way to tell the publishTo in Rpm to publishTo a different nexus endpoint? Perhaps a raw hosted repo?
是的,有。我不得不自己修改一下 sbt。您几乎做对了,但是 sbt/ivy 使用唯一的字符串名称来查找解析器,因此您必须将它们添加到正确的范围内。如果您可以在 sbt-native-packager 上打开一个问题以将其添加到 Deployment
插件中,那就太棒了。
// NOT NECESSARY. This resolver is automagically added to the `otherResolvers` setting.
publishTo := Some(Resolver.file("file-target", target.value / "ivy2" ))
// add your resolver to the `otherResolvers` setting and rpm:publish will find it
otherResolvers += Resolver.file("file-rpm", target.value / "ivy2-rpm")
publishTo in Rpm := Some(Resolver.file("file-rpm", target.value / "ivy2-rpm"))
Is there a way to push the rpm into the existing repo like we did in Nexus 2?
我不知道:(
希望第一个回答对您有所帮助:)
干杯,新年快乐, 向