How to load multiple library dependencies in SBT

SBT FAQ: How do I load multiple library dependencies in SBT? (i.e., what is the correct syntax?)

Solution: Use a Seq with the libraryDependencies syntax in your build.sbt file:

libraryDependencies ++= Seq(
    "net.sourceforge.htmlcleaner" % "htmlcleaner" % "2.4",
    "org.scalatest" % "scalatest_2.10" % "1.9.1" % "test",
    "org.foobar" %% "foobar" % "1.8"
)

The important part of that is knowing to use the ++= operator and a Seq.

On a related note, if you just have one SBT library dependency, just specify it with this build.sbt syntax:

libraryDependencies += "org.clapper" %% "argot" % "1.0.3"

Add new comment

The content of this field is kept private and will not be shown publicly.

Anonymous format

  • Allowed HTML tags: <em> <strong> <cite> <code> <ul type> <ol start type> <li> <pre>
  • Lines and paragraphs break automatically.
By submitting this form, you accept the Mollom privacy policy.