这是我第一次尝试发布一个工件,这是非常困难的。
我正在使用带有插件sbt-release 1.0.8、sbt-sonatype 2.0 sbt-pgp 1.1.1的sbt 0.13.8
我的构建sbt的相关部分如下所示:
pgpSecretRing := file("""C:\Users\kali\.sbt\gpg\secring.asc""")
pgpPublicRing := file("""C:\Users\kali\.sbt\gpg\pubring.asc""")
//pgpSecretRing := file("""C:\Users\kali\AppData\Local\lxss\home\kali\.gnupg\secring.gpg""")
//pgpPublicRing := file("""C:\Users\kali\AppData\Local\lxss\home\kali\.gnupg\pubring.gpg""")
usePgpKeyHex("c500a525a2efcb99")
name := "project-name"
organization := "com.mehmetyucel"
version := "0.0.2-SNAPSHOT"
scalaVersion := "2.12.2"
crossScalaVersions := Seq("2.11.11", "2.12.2")
lazy val projectName = project in file(".")
homepage := Some(url("https://some-github-url"))
scmInfo := Some(
ScmInfo(url(
"some-github-url"),
"some-github-url.git"))
developers := List(
Developer(
"mehmetyucel",
"Mehmet Yucel",
"mehmet@mehmetyucel.com",
url("some-github-url")))
licenses += ("MIT", url("http://opensource.org/licenses/MIT"))
publishMavenStyle := true
publishTo := Some(
if (isSnapshot.value)
Opts.resolver.sonatypeSnapshots
else
Opts.resolver.sonatypeStaging
)
releaseCrossBuild := true
releaseProcess := Seq[ReleaseStep](
checkSnapshotDependencies,
inquireVersions,
runClean,
runTest,
setReleaseVersion,
commitReleaseVersion,
tagRelease,
// For non cross-build projects, use releaseStepCommand("publishSigned")
releaseStepCommandAndRemaining("+publishSigned"),
setNextVersion,
commitNextVersion,
releaseStepCommand("sonatypeReleaseAll"),
pushChanges
)这里的前5行代码我是出于绝望才添加的,因为当我使用sbt release“我想”时,它会用我不知道的密钥给我的包签名。
我得到的错误消息是:
[info] Evaluate: signature-staging
[info] Failed: signature-staging, failureMessage:No public key: Key with id: (5b09423c9d5fbb5d) was not able to be located on <a href="http://keyserver.ubuntu.com:11371/">http://keyserver.ubuntu.com:11371/</a>. Upload your public key and try the operation again.但我的钥匙已经上传了。我可以在keyserver.ubuntu.com (http://keyserver.ubuntu.com/pks/lookup?op=get&search=0xC500A525A2EFCB99)上找到我的密钥,不幸的是,您会意识到这里的密钥id是不同的。我不知道这个"5b09423c9d5fbb5d“是从哪里来的。
我尝试将这个存储库克隆到3个不同的系统(macos,ubuntu和win10)中,创建一个全新的密钥,将密钥上传到ubuntu keyserver,然后再次尝试释放它。错误消息中的id总是相同的(5b09423c9d5fbb5d)我不知道这是从哪里来的,也不知道它是如何相同的,尽管使用了完全不同的密钥/系统
我尝试将usePgpKeyHex("c500a525a2efcb99")更改为usePgpKeyHex("c500a525a2efcb91") (基本上是一些不存在的东西),我得到
[error] Not a valid command: failure-- (similar: onFailure)
[error] Not a valid project ID: failure--
[error] Expected ':' (if selecting a configuration)
[error] Not a valid key: failure--
[error] failure--
[error] ^ 在签名阶段,这很棒,这实际上意味着sbt使用我的密钥签名,那么,5b09423c9d5fbb5d是从哪里来的?
发布于 2018-05-31 00:19:49
解决:显然这个密钥id来自于我为这个项目做的第一个"publishSigned“,因为另一个原因而失败了。我连续运行publishSigned sonatypeRelease好几次,这导致了很多“开放”的sonatype暂存库。
我访问了https://oss.sonatype.org/,使用nexus删除了所有打开的登台存储库,并重新启动了发布过程,一切都正常。
https://stackoverflow.com/questions/50606589
复制相似问题