Skip to content

Commit

Permalink
Fix build for Sonatype deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
chris-martin committed Oct 1, 2013
1 parent 0f03180 commit 4dc4a80
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 7 deletions.
33 changes: 32 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,39 @@ val e = b + ("F" -> "G") // A: 7, F: G
val f = a - "A" // D: E
```

## Build scripts
## Information for developers

### Build scripts

`./sbt` to launch the build tool (SBT).

`./checkstyle` to run Checkstyle.

### Deploying

#### Setting up SBT

Add your Sonatype login to `~/.sbt/0.13/sonatype.sbt`:

```
credentials += Credentials(
"Sonatype Nexus Repository Manager", "oss.sonatype.org",
"your-username", "your-password")
```

Optionally, include the passphrase for the PGP key.

```
pgpPassphrase := Some("your-pgp-passphrase".toArray)
```

#### Publishing to Sonatype

`./sbt publish`

This creates a staging repository at
https://oss.sonatype.org/index.html#stagingRepositories

*Close* the staging repository.

If all is well, you can then *Release* the repository.
15 changes: 9 additions & 6 deletions project/Build.scala
Original file line number Diff line number Diff line change
Expand Up @@ -131,15 +131,18 @@ object Build extends Build {

lazy val scalajHttp = "org.scalaj" % "scalaj-http_2.10" % "0.3.10"

lazy val unpublished: Seq[Setting[_]] = Seq(
publishArtifact := false,
publishArtifact in makePom := false,
publish := {},
publishLocal := {}
)
lazy val unpublished: Seq[Setting[_]] = {
Seq(
publishArtifact := false,
publishArtifact in makePom := false,
publish := {},
publishLocal := {}
)
}

lazy val published: Seq[Setting[_]] = Seq(
publishMavenStyle := true,
publish <<= com.typesafe.sbt.pgp.PgpKeys.publishSigned,
publishTo := {
val nexus = "https://oss.sonatype.org/"
if (version.value.trim.endsWith("SNAPSHOT"))
Expand Down
2 changes: 2 additions & 0 deletions project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
addSbtPlugin("de.johoop" % "findbugs4sbt" % "1.2.1")

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

0 comments on commit 4dc4a80

Please sign in to comment.