title: Publishing to Sonatype via SBT
body: <p>I am attempting to publish a scala library to the OSS Sonatype repository via SBT. I have followed the SBT guides for Publishing<a href="http://www.scala-sbt.org/0.13/docs/Publishing.html" rel="nofollow">0</a> &amp; <a href="http://www.scala-sbt.org/0.13/docs/Using-Sonatype.html" rel="nofollow">Using Sonatype</a> and reviewed the Sonatype <a href="http://central.sonatype.org/pages/requirements.html" rel="nofollow">requirements</a> documentation, but cannot seem to publish my artifacts. All attempts end with <code>java.io.IOException: Access to URL [...] was refused by the server: Forbidden</code>. I have had the necessary repository setup done in the <a href="https://issues.sonatype.org/browse/OSSRH-11092" rel="nofollow">Sonatype JIRA</a> system. I have created a PGP key and published it to <code>hkp://pool.sks-keyservers.net</code> &amp; <code>hkp://keyserver.ubuntu.com</code>.</p>
  
  <p><code>build.sbt</code></p>
  
  <pre><code>import play.twirl.sbt.SbtTwirl
  
  name := "spring-mvc-twirl"
  
  organization := "us.hexcoder"
  
  version := "1.0.0-SNAPSHOT"
  
  scalaVersion := "2.11.2"
  
  sbtVersion := "0.13.5"
  
  lazy val root = (project in file(".")).enablePlugins(SbtTwirl)
  
  // Removed for brevity    
  libraryDependencies ++= Seq()
  
  // Test dependencies
  // Removed for brevity
  libraryDependencies ++= Seq()
  
  // Publish configurations
  publishMavenStyle := true
  
  publishArtifact in Test := false
  
  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")
  }
  
  licenses := Seq("MIT" -&gt; url("http://opensource.org/licenses/MIT"))
  
  homepage := Some(url("https://github.com/67726e/Spring-MVC-Twirl"))
  
  credentials += Credentials(Path.userHome / ".sbt" / ".credentials")
  
  pomIncludeRepository := { _ =&gt; false }
  
  // Additional POM information for releases
  pomExtra :=
  &lt;developers&gt;
      &lt;developer&gt;
          &lt;name&gt;Glenn Nelson&lt;/name&gt;
          &lt;email&gt;glenn@hexcoder.us&lt;/email&gt;
      &lt;/developer&gt;
  &lt;/developers&gt;
  &lt;scm&gt;
      &lt;connection&gt;scm:git:git@github.com:67726e/Spring-MVC-Twirl.git&lt;/connection&gt;
      &lt;developerConnection&gt;scm:git:git@github.com:67726e/Spring-MVC-Twirl.git&lt;/developerConnection&gt;
      &lt;url&gt;git@github.com:67726e/Spring-MVC-Twirl.git&lt;/url&gt;
  &lt;/scm&gt;
  </code></pre>
  
  <p>SBT Output:</p>
  
  <pre><code>&gt; publishSigned
  [info] Wrote /Users/67726e/Documents/Spring-MVC-Twirl/target/scala-2.11/spring-mvc-twirl_2.11-1.0.0-SNAPSHOT.pom
  [info] :: delivering :: us.hexcoder#spring-mvc-twirl_2.11;1.0.0-SNAPSHOT :: 1.0.0-SNAPSHOT :: integration :: Tue Aug 19 09:57:13 EDT 2014
  [info]  delivering ivy file to /Users/67726e/Documents/Spring-MVC-Twirl/target/scala-2.11/ivy-1.0.0-SNAPSHOT.xml
  [trace] Stack trace suppressed: run last *:publishSigned for the full output.
  [error] (*:publishSigned) java.io.IOException: Access to URL https://oss.sonatype.org/content/repositories/snapshots/us/hexcoder/spring-mvc-twirl_2.11/1.0.0-SNAPSHOT/spring-mvc-twirl_2.11-1.0.0-SNAPSHOT-sources.jar was refused by the server: Forbidden
  [error] Total time: 5 s, completed Aug 19, 2014 9:57:18 AM
  &gt; last *:publishSigned
  java.io.IOException: Access to URL https://oss.sonatype.org/content/repositories/snapshots/us/hexcoder/spring-mvc-twirl_2.11/1.0.0-SNAPSHOT/spring-mvc-twirl_2.11-1.0.0-SNAPSHOT-sources.jar was refused by the server: Forbidden
      at org.apache.ivy.util.url.AbstractURLHandler.validatePutStatusCode(AbstractURLHandler.java:79)
      at org.apache.ivy.util.url.BasicURLHandler.upload(BasicURLHandler.java:264)
      at org.apache.ivy.util.FileUtil.copy(FileUtil.java:150)
      at org.apache.ivy.plugins.repository.url.URLRepository.put(URLRepository.java:84)
  </code></pre>