PlayFramework在每次启动时都会解决依赖关系 [英] PlayFramework resolves dependencies every launch

查看:78
本文介绍了PlayFramework在每次启动时都会解决依赖关系的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

每次我启动应用程序播放时,都会解决依赖关系.考虑到发生这种情况,每次启动都需要花费很多时间...曾经有一段时间,我遇到了一个无法使用的lib问题,因此该应用没有启动...是否仍然需要配置play/SBT才能正常工作Maven?下载依赖项并使用本地方法解决每次启动问题?

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?

推荐答案

是的,您可以执行此操作.将skip in update := true添加到 build.sbt 文件中以停止依赖关系解析.我的 build.sbt 看起来像

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"
)

... 

您可以在类型安全sbt文档中阅读有关依赖关系调整的更多信息: http://www.scala-sbt.org/release/docs/Dependency-Management-Flow.html

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

顺便说一句,文档说:

如果自上次以来没有任何依赖关系管理配置发生更改 成功解决并且检索到的文件仍然存在,sbt 不要求常春藤执行决议.

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

这篇关于PlayFramework在每次启动时都会解决依赖关系的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆