Share this question

Welcome to Teachnovice Q&A, where you can ask questions and receive answers from other members of the community.

This is a collaboratively edited question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

How to publish to Sonatype using publishSigned from sbt-pgp?

0 like 0 dislike

I want to publish a Scala library with sbt using sbt-pgp 0.8. I've registered groupId org.bitbucket.sergey_kozlov at Sonatype.

My build.sbt:

organization := "org.bitbucket.sergey_kozlov"

name := "playingcards"

version := "0.1-SNAPSHOT"

publishMavenStyle := true

publishTo := {
    val nexus = ""
    if (isSnapshot.value)
        Some("snapshots" at nexus + "content/repositories/snapshots")
        Some("releases"  at nexus + "service/local/staging/deploy/maven2")

publishArtifact in Test := false

pomIncludeRepository := { _ => false }

pomExtra :=
                <name>The MIT License</name>
                <name>Sergey Kozlov</name>

libraryDependencies += "junit" % "junit" % "4.11"

libraryDependencies += "org.scalatest" % "scalatest_2.10" % "2.0" % "test"

There's also ~/.sbt/0.13/plugins/gpg.sbt:

addSbtPlugin("com.typesafe.sbt" % "sbt-pgp" % "0.8")

No other files are under project/ directory that contribute to the build definition.

When I enter publishSigned in sbt console, I get the following error:

[error] (*:publishSigned) Access to URL was refused by the server: Forbidden

Note that the URL does not contain organization.

How can I publish my artifact correctly?

asked Jan 24, 2015 by user1559111  
I don't immediately see any issues in your build.sbt file. Do you have any project/*.scala files which may be manipulating the expected values?
What's your project/plugins.sbt? I suspect that publishSigned comes from or
@joescii I have no *.scala files in the project directory.
@JacekLaskowski My project/plugins.sbt contains only logLevel := Level.Warn, but there is ~/.sbt/0.13/plugins/gpg.sbt with such content: addSbtPlugin("com.typesafe.sbt" % "sbt-pgp" % "0.8")

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
Anti-spam verification:
To avoid this verification in future, please log in or register.