为什么 play 是插件而不是 sbt 的库依赖项?

Why play is a plugin but not a library dependency for sbt?

在查看播放项目时,我在 /project/plugins.sbt 中找到了这一行:

addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.7.0")

但是我在 built.sbt 中找不到 libraryDependencies ++= ... 的游戏。

这很混乱。

尽管我们可以将各种 Play 组件直接添加到 build.sbt 中的 libraryDependencies,但 Play 的 sbt-plugin 会通过添加

来为我们解决这个问题
"com.typesafe.play" %% "play" % play.core.PlayVersion.current % "provided"

以及 libraryDependencies 的其他相关依赖项。有关 Play 的 SBT 插件的更多信息,请参阅 相关答案。 ,