Permalink
Browse files

Update src/jekyll/using_sonatype.md

  • Loading branch information...
1 parent 919519a commit 174b969488b9b297ea3b8e80a1e9f0de60442d10 @Sciss Sciss committed Feb 13, 2012
Showing with 12 additions and 2 deletions.
  1. +12 −2 src/jekyll/using_sonatype.md
@@ -40,7 +40,7 @@ Now, we want to control what's available in the `pom.xml` file. This file descr
First, let's make sure no repositories show up in the POM file. To publish on maven-central, all *required* artifacts must also be hosted on maven central. However, sometimes we have optional dependencies for special features. If that's the case, let's remove the repositories for optional dependencies in our artifact:
- pomIncludeRepository := { x => false }
+ pomIncludeRepository := { _ => false }
Next, the POM metadata that isn't generated by SBT must be added. This is done through the `pomExtra` configuration option:
@@ -67,6 +67,14 @@ Next, the POM metadata that isn't generated by SBT must be added. This is done
Specifically, the `url`, `license`, `scm.url`, `scm.connection` and `developer` sections are required. The above is an example from the [scala-arm](http://jsuereth.com/scala-arm) project.
+*Note* that sbt will automatically inject `licenses` and `url` nodes if they are already present in your build file. Thus an alternative to the above `pomExtra` is to include the following entries:
+
+ licenses := Seq("BSD-style" -> url("http://www.opensource.org/licenses/bsd-license.php"))
+
+ homepage := Some(url("http://jsuereth.com/scala-arm"))
+
+This might be advantageous if those keys are used also by other plugins (e.g. `ls`). You **cannot use both** the sbt `licenses` key and the `licenses` section in `pomExtra` at the same time, as this will produce duplicate entries in the final POM file, leading to a rejection in Sonatype's staging process.
+
*The full format of a pom.xml file is [outlined here](http://maven.apache.org/pom.html).*
## Fourth - Adding credentials ##
@@ -111,6 +119,8 @@ After publishing you have to follow the [Release workflow of nexus](https://docs
*Note: Staged releases allow testing across large projects of independent releases before pushing the full project.*
+<sub>*Note:* An error message of `PGPException: checksum mismatch at 0 of 20` indicates that you got the passphrase wrong. We have found at least on OS X that there may be issues with characters outside the 7-bit ASCII range (e.g. Umlauts). If you are absolutely sure that you typed the right phrase and the error doesn't disappear, try changing the passphrase.</sub>
+
## Summary ##
To get your project hosted on Sonatype (and Maven Central), you will need to:
@@ -156,7 +166,7 @@ Finally, you'll need to tweak the generated POM in your `build.sbt`. The tweaks
publishArtifact in Test := false
- pomIncludeRepository := { x => false }
+ pomIncludeRepository := { _ => false }
pomExtra := (
<url>http://your.project.url</url>

0 comments on commit 174b969

Please sign in to comment.