问题
a couple days ago i started to learn scala. I want to use sbt for the dependency management but when i start sbt in my console it need round about 1h to resolving and downloading all dependencies.
My search at google was unsuccessfull so i hope somebody can help me to speed up sbt.
My build.sbt
name := "hello"
version := "1.0"
scalaVersion := "2.11.2"
scalacOptions := Seq("-unchecked", "-deprecation", "-encoding", "utf8")
libraryDependencies ++= {
val akkaV = "2.3.5"
val sprayV = "1.3.1"
Seq(
"io.spray" %% "spray-can" % sprayV,
"io.spray" %% "spray-routing" % sprayV,
"io.spray" %% "spray-testkit" % sprayV % "test",
"com.typesafe.akka" %% "akka-actor" % akkaV,
"com.typesafe.akka" %% "akka-testkit" % akkaV % "test",
"org.specs2" %% "specs2-core" % "2.3.11" % "test"
)
}
I use Mac OS X 10.8 with java 1.8.20
Greets
der commander
回答1:
Hahaha welcome to sbt hell!! I find one trick is to interupt (ctrl + c) the process and restart it. It somtimes seems to get stuck and needs a kick. It will pick up where it left off thanks to the cache.
Fortunately its usually only the first time you run it it takes that long. Until you change your dependencies that is!!
回答2:
it seems that i have a very slow connection to the maven central. After i change the default maven repository from the UK to France it needs only 3 minutes. I think this is ok for my internet connection and a clear start.
Thanks for your suggestions.
回答3:
For what it's worth, I "solved" my case by building on a remote machine with a fast network connection.
来源:https://stackoverflow.com/questions/25798460/sbt-stuck-while-downloading