发布工件上的pgp签名失败

时间:2018-05-30 13:57:21

标签: scala maven sbt sonatype

这是我第一次尝试发布工件,而且不会更难。

我正在使用sbt 0.13.8插件sbt-release 1.0.8sbt-sonatype 2.0 sbt-pgp 1.1.1

我的构建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是不同的。我不知道这个&#34; 5b09423c9d5fbb5d&#34;来自。

我尝试将存储库克隆到3个不同的系统(macos,ubuntu和win10)创建一个全新的密钥上传密钥到ubuntu密钥服务器并尝试再次发布它。错误消息中的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来自哪里?

1 个答案:

答案 0 :(得分:0)

解决: 显然,这个密钥ID来自我为这个项目做的第一个“publishSigned”,由于另一个原因而失败了。我一直在运行publishSigned sonatypeRelease很多次,这导致很多“开放”的分段存储库处于sonatype状态。

我转到https://oss.sonatype.org/并使用nexus UI删除了所有打开的暂存存储库并重新启动了发布过程,一切正常。

相关问题