-->

PlayFramework resolves dependencies every launch

2019-08-13 02:54发布

问题:

Every time I launch my app play resolves dependencies. Considering this happens every single launch takes a lot of time... There was a time I had problem with one lib that wasn't unavailable so the app didn't launch... Is there anyway to configure play/SBT to work like Maven? Download dependencies and use local instead resolve every launch?

回答1:

Yes, you can do this. Add skip in update := true in to the build.sbt file to stop dependencies resolution. My build.sbt looks like

...

scalaVersion := "2.11.6"

skip in update := true

libraryDependencies ++= Seq(
  javaJdbc,
  cache,
  javaWs,
  "com.datastax.cassandra" % "cassandra-driver-core" % "2.1.6"
)

... 

You can read more about dependency tuning in the typesafe sbt documentation: http://www.scala-sbt.org/release/docs/Dependency-Management-Flow.html

btw, documentation says:

if no dependency management configuration has changed since the last successful resolution and the retrieved files are still present, sbt does not ask Ivy to perform resolution.

I have exactly this behaviours, so I am not sure why do you have:

Every time I launch my app play resolves dependencies