gpt4 book ai didi

java - Play 2 : Difference between appDependencies and libraryDependencies?

转载 作者:搜寻专家 更新时间:2023-10-30 21:20:33 26 4
gpt4 key购买 nike

Playframework 2 App (2.2.x) 中有一个 build.sbt 文件。在此文件中,应指定应用程序的依赖项。

一些文档写到

val appDependencies = Seq(put dependencies here)

默认情况下有一个

libraryDependencies ++= Seq(put dependencies here)

什么时候吃什么?appDependencies 和 libraryDependencies 有什么区别?

干杯

最佳答案

我猜你混淆了 sbt build.sbtBuild.scala 的定义(参见 sbt Build definition )。

libraryDependencies 是由 sbt 定义的键,您可以在 build.sbt 文件(基本上是键值存储)中使用。但是,没有预定义的 appDependencies 键。

你举的例子

val appDependencies = Seq(put dependencies here)

只是一个普通变量,可以有任意名称。您也可以将其命名为 dependenciesForTehLulz。原因是这个变量是用来稍后将依赖项传递给 Project 定义构造函数的,它的名字根本无关紧要:

val main = play.Project(appName, appVersion, **appDependencies**).settings(
...
)

这只有在 Build.scala 风格的项目定义中才有可能。

关于java - Play 2 : Difference between appDependencies and libraryDependencies?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20019617/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com