【发布时间】:2014-09-10 07:13:45
【问题描述】:
我想使用 sbt-pgp 0.8 发布一个带有 sbt 的 Scala 库。我在 Sonatype 注册了 groupId org.bitbucket.sergey_kozlov。
我的build.sbt:
organization := "org.bitbucket.sergey_kozlov"
name := "playingcards"
version := "0.1-SNAPSHOT"
publishMavenStyle := true
publishTo := {
val nexus = "https://oss.sonatype.org/"
if (isSnapshot.value)
Some("snapshots" at nexus + "content/repositories/snapshots")
else
Some("releases" at nexus + "service/local/staging/deploy/maven2")
}
publishArtifact in Test := false
pomIncludeRepository := { _ => false }
pomExtra :=
<url>https://bitbucket.org/sergey_kozlov/playingcards</url>
<licenses>
<license>
<name>The MIT License</name>
<url>http://www.opensource.org/licenses/mit-license.php</url>
<distribution>repo</distribution>
</license>
</licenses>
<scm>
<url>https://bitbucket.org/sergey_kozlov/playingcards.git</url>
<connection>scm:git:ssh://git@bitbucket.org/sergey_kozlov/playingcards.git</connection>
</scm>
<developers>
<developer>
<id>skozlov</id>
<name>Sergey Kozlov</name>
<email>mail.sergey.kozlov@gmail.com</email>
<roles>
<role>architect</role>
<role>developer</role>
</roles>
</developer>
</developers>
libraryDependencies += "junit" % "junit" % "4.11"
libraryDependencies += "org.scalatest" % "scalatest_2.10" % "2.0" % "test"
还有~/.sbt/0.13/plugins/gpg.sbt:
addSbtPlugin("com.typesafe.sbt" % "sbt-pgp" % "0.8")
project/ 目录下没有其他有助于构建定义的文件。
当我在 sbt 控制台输入publishSigned 时,我得到以下错误:
[error] (*:publishSigned) java.io.IOException: Access to URL https://oss.sonatype.org/content/repositories/snapshots/playingcards/playingcards_2.10/0.1-SNAPSHOT/playingcards_2.10-0.1-SNAPSHOT-sources.jar was refused by the server: Forbidden
请注意,该 URL 不包含 organization。
如何正确发布我的工件?
【问题讨论】:
-
我没有立即在您的
build.sbt文件中看到任何问题。您是否有任何project/*.scala文件可能正在操纵预期值? -
你的
project/plugins.sbt是什么?我怀疑publishSigned来自sbt-pgp 或sbt-sonatype。 -
@joescii 我在
project目录中没有*.scala文件。 -
@JacekLaskowski 我的
project/plugins.sbt只包含logLevel := Level.Warn,但有~/.sbt/0.13/plugins/gpg.sbt有这样的内容:addSbtPlugin("com.typesafe.sbt" % "sbt-pgp" % "0.8")