Reputation: 478
I'm making an SBT task that needs to make a multipart POST request to a certain server. I want to use Dispatch to make the request. I have the following in build.sbt
at the top level of my project:
libraryDependencies ++= Seq(
"net.databinder.dispatch" %% "dispatch-core" % "0.9.5"
)
The task definition is in project/Build.scala
. I have
import sbt._
import Keys._
import dispatch._
object SubmitBuild extends Build {
...
}
I get the following error message:
[error] /Users/ken/xxxxtools/project/Build.scala:3: not found: object dispatch
[error] import dispatch._
[error] ^
If I remove import dispatch._
then sbt will compile. I know I have Dispatch installed. Why can't SBT find it?
Upvotes: 3
Views: 5814
Reputation: 12783
If you want to make references in Build.scala to some dependency it has to be declared in build's project not in the "project project". Meaning that it should be project/build.sbt
.
It turns out that project/Build.scala
is also a SBT project in the same way your project is.
SBT authors give a very good explanation in sbt is recursive.
Upvotes: 7