guigui
guigui

Reputation: 103

SBT - Class not found, continuing with a stub

I am currently migrating my Play 2 Scala API project and encounter 10 warnings during the compilations indicating :

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

All of them are the same, and I don't have any other indications. I've searched a bit for other similar cases, it's often because of the JDK version and so on but I'm already in 1.8.

Here's what I have in 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")

and in 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")
    )
)

Don't hesitate if you need anything else :)

It's not something that blocks me but I'd prefer avoid these 10 warnings everytime I recompile my application.

Thank you ! :)

Upvotes: 5

Views: 5636

Answers (1)

Salem
Salem

Reputation: 12986

It seems something in your code is trying to use the Play enhancer and is failing to find it. Are you using Ebean or something that may require the enhancer?

You can try to add the plugin to your plugins.sbt

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

This should make the warning go away. You can then disable it if you like:

# In build.sbt
playEnhancerEnabled := false

Upvotes: 2

Related Questions