Skip to content
hamnis edited this page Oct 10, 2012 · 3 revisions

Example build file

import aether._
import sbt._
import sbt.Keys._

object Build extends sbt.Build {
  lazy val buildSettings = Defaults.defaultSettings ++ Aether.aetherSettings ++ Seq(
    organization := "com.example",
    scalaVersion := "2.9.1",
    crossScalaVersions := Seq("2.9.1"),
    publishTo <<= (version) apply {
      (v: String) => if (v.trim().endsWith("SNAPSHOT")) Some(Resolvers.sonatypeNexusSnapshots) else Some(Resolvers.sonatypeNexusStaging)
    },
    credentials += Credentials(Path.userHome / ".sbt" / ".credentials"),    
    pomIncludeRepository := { x => false }
  )

  lazy val root = Project(
    id = "example",
    base = file("."),
    settings = buildSettings ++ Seq(
      description := "Example project",
      name := "example", 
      libraryDependencies := Seq(),
    manifestSetting
    )
  )

  object Resolvers {
    val sonatypeNexusSnapshots = "Sonatype Nexus Snapshots" at "https://oss.sonatype.org/content/repositories/snapshots"
    val sonatypeNexusStaging = "Sonatype Nexus Staging" at "https://oss.sonatype.org/service/local/staging/deploy/maven2"
  }
}
Clone this wiki locally