这是我的build.sbt
文件,我得到了关于“PlayScala”无法解决addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.8.19")
的错误,这已经添加到plugin.sbt
中,版本中没有问题
lazy val root = (project in file("."))
.enablePlugins(PlayScala)
.settings(
name := """play-scala-hello-world-tutorial""",
organization := "com.example",
version := "1.0-SNAPSHOT",
scalaVersion := "2.13.10",
libraryDependencies ++= Seq(
"com.google.inject" % "guice" % "5.1.1",
"org.scalatestplus.play" %% "scalatestplus-play" % "5.1.0" % Test
),
scalacOptions ++= Seq(
"-feature",
"-deprecation",
"-xfatal-warnings"
)
)
1条答案
按热度按时间v1uwarro1#
https://www.playframework.com/getting-started
project/build.properties
。使用sbt 1.7.2-
如果您使用的是sbt 1.7.3+(1.8.x),则应将以下内容添加到
project/plugins.sbt
https://github.com/playframework/playframework/issues/11522
https://mvnrepository.com/artifact/com.google.inject/guice
5.1.1快照
https://oss.sonatype.org/content/repositories/snapshots/com/google/inject/guice/
https://oss.sonatype.org/content/groups/public/com/google/inject/guice/
JDK 8是默认值。从Play 2.8.x开始支持JDK 11
https://www.playframework.com/documentation/2.8.19/Highlights28#Java-11-support
在JDK 17中,需要进行一些调整
如果您使用的是Guice,则必须使用最新版本...
https://github.com/playframework/playframework/releases/2.8.15
但是你已经在使用最新的(甚至更新鲜的)Guice了,所以这应该没问题。
NoSuchMethodError with Play scala.tools.nsc.Settings.bootclasspath()
(but这是在运行时,而不是构建时)。