首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >禁止twirl模板弃用方法警告

禁止twirl模板弃用方法警告
EN

Stack Overflow用户
提问于 2017-06-21 15:56:14
回答 1查看 105关注 0票数 0

从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警告吗?谢谢

EN

回答 1

Stack Overflow用户

发布于 2017-06-22 16:04:43

如果我们想抑制deprecation警告,我们应该在next way -deprecation:false中用false修改标志,例如:

scalacOptions ++= Seq("-deprecation:false")

谷歌群组讨论here

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/44670058

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档