从play 2.4迁移到2.5后,我们在twirl模板内部遇到了不推荐使用的警告:...web/templates/main.scala.html:159: method get in object Messages is deprecated: see corresponding Javadoc for more information. [warn] <a href="@routes.Authentication.login()">@Messages.get("login") </a> [warn] 1501 warnings found
scalaOptions中的-deprecation标志对于类工作得很好,但看起来不会影响*.scala.html文件。
Twirl wiki提到了withtwirlRecompilationLogger TaskKey (twirlRecompilationLogger = TaskKey[(File, File) => Unit]),但play 2.5没有包含它(play.twirl.sbt.TwirlKeys)。
有什么想法可以抑制模板中的deprecation警告吗?谢谢
发布于 2017-06-22 16:04:43
如果我们想抑制deprecation警告,我们应该在next way -deprecation:false中用false修改标志,例如:
scalacOptions ++= Seq("-deprecation:false")
谷歌群组讨论here。
https://stackoverflow.com/questions/44670058
复制相似问题