error after upgrade to play 2.4 from play2.3

落爺英雄遲暮 提交于 2019-12-11 17:58:32

问题


After making the following change to upgrade from play framework 2.3 to play 2.4:

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

as well for the sbt version:

sbt.version=0.13.8

I got the following error:

trace] Stack trace suppressed: run last myProject-app-server/compile:playRoutes for the full output.
[error] (myProject-app-server/compile:playRoutes) java.lang.NoSuchMethodError: play.routes.compiler.inject.twirl.forwardsRouter_Scope0$forwardsRouter._display_(Ljava/lang/Object;Lscala/reflect/Manifest;)Lplay/twirl/api/Appendable;

as I understand from my research NoSuchMethodError is due to a version conflict, besides the compilation log displays warning of version conflict like so:

warn] Multiple dependencies with the same organization/name but different versions. To avoid conflict, pick one version:
[warn]  * org.scala-lang:scala-compiler:(2.11.4, 2.11.11)
[warn]  * org.scala-lang:scala-reflect:(2.11.4, 2.11.11)
[warn]  * org.scala-lang.modules:scala-parser-combinators_2.11:(1.0.2, 1.0.4)
[warn]  * org.scala-lang.modules:scala-xml_2.11:(1.0.2, 1.0.5)

so here is the sbt file:

ullResolvers := Seq(
  projectResolver.value,
  Resolver.defaultLocal,
  "meta-maven" at "http://artifactory/artifactory/meta-maven",
  Resolver.url("meta-ivy", url("http://artifactory/artifactory/meta-ivy"))(Resolver.ivyStylePatterns))


addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "0.13.0")

addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.4.3")
addSbtPlugin("com.typesafe.sbt" % "sbt-twirl" % "1.0.4")
addSbtPlugin("com.typesafe.sbt" % "sbt-coffeescript" % "1.0.0")
addSbtPlugin("com.typesafe.sbt" % "sbt-less" % "1.0.4")
addSbtPlugin("com.typesafe.sbt" % "sbt-license-report" % "1.2.0")

as I see from the Jar files: the class forwardsRouter package play.routes.compiler.static.twirl does not contain the display method. I do not understand why play needs this method and could it be transferred to another package?

来源:https://stackoverflow.com/questions/56663300/error-after-upgrade-to-play-2-4-from-play2-3

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!