Scala Play / SBT如何更改仓库解析器顺序

13

有没有一种方法在构建期间更改解析器的选择顺序。我的目标是,当尝试本地和内部仓库未找到时,最后尝试类型安全仓库。

我在我的Play框架中的*.boot.properties文件中进行了更改(你可以看到我用本地替换了“typesafe”):

[repositories]
  local
  maven-local
  play-local: file:///C:/path/to/my/play/repository/locl/, [organization]/[module]/[revision]/[type]s/[artifact](-[classifier]).[ext]
  typesafe-ivy-releases: https://locl/repo/address/, [organization]/[module]/[revision]/[type]s/[artifact](-[classifier]).[ext]
  maven-central

然而,在我的构建过程中,typesafe仓库仍然被加载

[debug]         URLRepository(typesafe-ivy-releases,Patterns(ivyPatterns=List(http://repo.typesafe.com/typesafe/ivy-releases/[organisation]/[module]/(scala_[scalaVersion]/)(sbt_[sbtVersion]/)[revision]/[type]s/[artifact](-[classifier]).[ext]), artifactPatterns=List(http://repo.typesafe.com/typesafe/ivy-releases/[organisation]/[module]/(scala_[scalaVersion]/)(sbt_[sbtVersion]/)[revision]/[type]s/[artifact](-[classifier]).[ext]), isMavenCompatible=false))

有没有关于如何让类型安全库在其他解析器之后运行的想法?


这看起来与我的问题类似,但我正在使用更新的Play版本,而且我没有.sbt目录。 我不确定那个线程中的~(home)是指%PLAY_HOME%还是%USER_HOME%。 - anonymoose
1个回答

1

我理解您希望尽可能使用本地存储库。

您不需要存储库的顺序。只需使用SBT键设置:

val offline = true

以下是SBT文档中对其的解释:
val offline = SettingKey[Boolean]("offline", "Configures sbt to work without a network connection where possible.", ASetting)

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接