SBT - Class 未找到,继续存根

SBT - Class not found, continuing with a stub

我目前正在迁移我的 Play 2 Scala API 项目并在编译过程中遇到 10 个警告:

[warn] Class play.core.enhancers.PropertiesEnhancer$GeneratedAccessor not found - continuing with a stub.

都是一样的,我也没有其他的迹象。我已经搜索了一些其他类似的情况,这通常是因为 JDK 版本等等,但我已经在 1.8.

这是我在 plugins.sbt 中的内容:

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

addSbtPlugin("org.scalastyle" %% "scalastyle-sbt-plugin" % "0.8.0")

addSbtPlugin("com.sksamuel.scapegoat" %% "sbt-scapegoat" % "1.0.4")

并在 build.sbt 中:

libraryDependencies ++= Seq(
  cache,
  ws,
  "org.reactivemongo" %% "play2-reactivemongo" % "0.10.5.0.akka23",
  "org.reactivemongo" %% "reactivemongo" % "0.10.5.0.akka23",
  "org.mockito" % "mockito-core" % "1.10.5" % "test",
  "org.scalatestplus" %% "play" % "1.2.0" % "test",
  "com.amazonaws" % "aws-java-sdk" % "1.8.3",
  "org.cvogt" %% "play-json-extensions" % "0.8.0",
  javaCore,
  "com.clever-age" % "play2-elasticsearch" % "1.1.0" excludeAll(
    ExclusionRule(organization = "org.scala-lang"),
    ExclusionRule(organization = "com.typesafe.play"),
    ExclusionRule(organization = "org.apache.commons", artifact = "commons-lang3")
    )
)

如果您还需要什么,请不要犹豫:)

这不是阻碍我的事情,但我更愿意在每次重新编译我的应用程序时避免这 10 个警告。

谢谢! :)

您的代码中似乎有某些内容正在尝试使用 Play 增强器,但未能找到它。您使用的是 Ebean 还是可能需要增强器的东西?

您可以尝试将插件添加到您的 plugins.sbt

addSbtPlugin("com.typesafe.sbt" % "sbt-play-enhancer" % "1.1.0")

这应该会使警告消失。然后,如果您愿意,可以禁用它:

# In build.sbt
playEnhancerEnabled := false