PlayFramework resolves dependencies every launch

南楼画角 提交于 2020-01-25 04:30:27

问题


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



来源:https://stackoverflow.com/questions/33049591/playframework-resolves-dependencies-every-launch

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!