我正在尝试使用sbt-release,sbt-pgp和sbt-sonatype插件将多项目发布为sonatype。
在运行时:sbt publishLocalSigned
我看到.asc
文件已发布。
但是将sbt release运行为sonatype时,我只能看到.md5
和sha1
文件。
这是我的release.sbt
:
import ReleaseTransformations._
// publishing
publishMavenStyle in ThisBuild := true
credentials in ThisBuild += Credentials(Path.userHome / ".ivy2" / ".credentials_sonatype")
publishTo in ThisBuild := {
val nexus = "https://oss.sonatype.org/"
if (version.value.trim.endsWith("SNAPSHOT"))
Some("snapshots" at nexus + "content/repositories/snapshots")
else
Some("releases" at nexus + "service/local/staging/deploy/maven2")
}
publishArtifact in Test := false
pomIncludeRepository in ThisBuild := { _ => false }
pomExtra in ThisBuild := {
<url>my.url</url>
<licenses>
<license>
<name>The Apache Software License, Version 2.0</name>
<url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
<distribution>repo</distribution>
</license>
</licenses>
<scm>
<connection>scm:git:git@github.com:url.git</connection>
<developerConnection>scm:git:git@github.com:url.git</developerConnection>
<url>url</url>
</scm>
<developers>
<developer>
<id>dev</id>
<name>dev</name>
<email>dev@gmail.com</email>
</developer>
</developers>
}
// use maven style tag name
releaseTagName in ThisBuild := s"${name.value}-${(version in ThisBuild).value}"
// sign artifacts
releasePublishArtifactsAction in ThisBuild := PgpKeys.publishSigned.value
// don't push changes (so they can be verified first)
releaseProcess in ThisBuild := Seq(
checkSnapshotDependencies,
inquireVersions,
runTest,
setReleaseVersion,
commitReleaseVersion,
tagRelease,
publishArtifacts,
setNextVersion,
commitNextVersion,
pushChanges,
releaseStepCommand("sonatypeRelease")
)
我的plugin.sbt
:
addSbtPlugin("org.scoverage" % "sbt-scoverage" % "1.5.1")
addSbtPlugin("org.scoverage" % "sbt-coveralls" % "1.2.7")
addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "2.3")
addSbtPlugin("com.jsuereth" % "sbt-pgp" % "1.1.0")
addSbtPlugin("com.github.gseitz" % "sbt-release" % "1.0.11")
我确定我的gpg密钥设置正确,否则我将无法运行publishLocalSigned
,但似乎我想念我的sbt-gpg插件无法发布。
sbt版本是1.2.8,我试图降级到0.13.17并得到了相同的行为。
不得不提的是,我主要遵循的是jackson-module-scala方法: https://github.com/FasterXML/jackson-module-scala/blob/master/release.sbt