For testing purposes, the easiest way to go is jitpack:
resolvers += "jitpack" at "https://jitpack.io"
libraryDependencies += "com.github.User" % "Repo" % "Tag"
https://issues.sonatype.org/projects/OSSRH
https://issues.sonatype.org/secure/CreateIssue.jspa?issuetype=21&pid=10134
plugins.sbt
addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "3.9.2")
addSbtPlugin("com.jsuereth" % "sbt-pgp" % "2.0.1")
build.sbt:
pgpSecretRing in Global := file("secring.gpg")
pgpPublicRing in Global := file("pubring.gpg")
pgpPassphrase in Global := Some("".toCharArray)
organization in Global := "com.github.bla"
pomExtra := {
<url>https://github.com/organisation/repository</url>
<licenses>
<license>
<name>Apache 2</name>
<url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
</license>
</licenses>
<scm>
<url>https://github.com/organisation/repository</url>
<connection>scm:git:git@github.com:organisation/repository.git</connection>
</scm>
<developers>
<developer>
<id>dev1</id>
<name>Full Name</name>
<url>https://github.com/dev1</url>
</developer>
<developer>
<id>dev2</id>
<name>Full Name</name>
<url>https://github.com/dev2</url>
</developer>
</developers>
}
$ sbt "set pgpReadOnly := false" "pgp-cmd gen-key"
$ sbt "set pgpReadOnly := false" "pgp-cmd send-key aaaabbbbccccdddd http://pgp.mit.edu:11371"
sonatype.sbt
// this has to go in an sbt file because if we use an external
// credentials properties file it ignores it
credentials in Global += Credentials(
"Sonatype Nexus Repository Manager",
"oss.sonatype.org",
"username",
"password"
)
*.gpg
sonatype.sbt
$ sbt ++publishSigned
$ sbt ++publishSigned
$ sbt sonatypeReleaseAll