播放框架2.1缓慢解析内部依赖关系 [英] Playframework 2.1 slow resolving of internal dependencies

查看:264
本文介绍了播放框架2.1缓慢解析内部依赖关系的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们正在为自己的游戏项目所依赖的图书馆使用一个内部的音乐类型存储库。最近,该项目已经花了大约10分钟才能开始(使用播放运行),因为解决速度很慢。

We're using a in house sonatype repository for our own libraries which our play project depend upon. Lately the project have been taking around 10 minutes to start (using play run) because the resolving is slow.

试图看看发生了什么,我正在运行一个 ngrep port 80 。我看到很多来自类型安全存储库的缓慢响应,这回答说我们自己的库不在他们的回购中。

Trying to see what's happening I'm running a ngrep port 80. I see alot of slow responses from the typesafe repository which answer that our own libraries isn't in their repo.

示例:

T <my-internal-ip>:41907 -> 54.236.91.228:80 [AP]
  HEAD /typesafe/snapshots/<our-pom-file-here> HT
  TP/1.1..User-Agent: Apache Ivy/2.3.0-rc1..Host: repo.typesafe.com..Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2..Connection: keep-alive....                                         
#########
T 54.236.91.228:80 -> <my-iternal-ip>:41907 [AP]
  HTTP/1.1 404 Not Found..Content-Type: application/json;charset=ISO-8859-1..Date: Wed, 07 May 2014 
  14:10:32 GMT..Server: Artifactory/3.2.0..X-Artifactory-Id: typesafe2-use-1e-typesafereadonly..Connection: keep-alive.... 

所以我想要sbt首先搜索我们自己的存储库,它现在似乎不在做。我们已经在Build.scala中添加了我们的存储库,如:

So I would like sbt to search our own repository first which it dosen't seem to be doing at the moment. We've added our repositories in Build.scala like:

val main = play.Project(appName, appVersion, appDependencies)
[...]
.settings(
  [...]
  resolvers += "nexus" at "<URL>",
  [...]

任何建议如何告诉sbt在尝试使用类型安全性之前搜索我们的本地资料?

Any suggestions how to tell sbt to search our local repos before trying with typesafe?

推荐答案

您必须覆盖解析器,目前您将在键入Safe的解析器,您可以键入 show resolvers 以显示当前声明的解析器的列表。

You have to override the resolvers. Currently you're appending your repository after the Type Safe's resolver. You can type show resolvers to show the list of currently declared resolvers.

如果你想要存储库在类型安全之前,您必须替换当前列表,而不是 + = 通过覆盖该键:= (SBT 0.13.x或更高版本)或〜=

If you want your repository to come before typesafe you have to replace the current list. Instead of += override the key by either := (SBT 0.13.x or newer) or ~= for older SBT versions.

resolvers ~= ( resolvers => ("My Company Releases" at "http://mycompany.com/releases") +: resolvers)



播放2.2.x (SBT 0.13以上)



Play 2.2.x (SBT 0.13 or greater)

resolvers := ("My Company Releases" at "http://mycompany.com/releases") +: resolvers.value

这不会覆盖所有解析器。还有 externalResolvers ,可能会被覆盖,因为它是在文档中描述

This will not override all resolvers. There are also externalResolvers, which may be overridden as it is described in the documentation

这篇关于播放框架2.1缓慢解析内部依赖关系的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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