Play Framework编译发出警告,如何查看警告? [英] Play Framework compile giving warnings, how to view them?
问题描述
如何从控制台在Play应用上运行compile
时看到警告?
How do I see the warnings created during running compile
on my Play app from the console?
[info] Done updating.
[info] Compiling 13 Scala sources and 2 Java sources to C:\...\target\scala-2.10\classes...
[warn] there were 1 feature warning(s); re-run with -feature for details
[warn] one warning found
[success] Total time: 13 s, completed 13-Feb-2014 00:43:23
我尝试先运行clean
然后运行compile -feature
,但这只会引发错误.
I tried running clean
then compile -feature
but that just threw errors.
我正在使用:
_
_ __ | | __ _ _ _
| '_ \| |/ _' | || |
| __/|_|\____|\__ /
|_| |__/
play 2.2.1 built with Scala 2.10.2 (running Java 1.7.0_51), http://www.playframework.com
推荐答案
请注意,这与标准警告(默认情况下会正常显示)略有不同.
As a note, this is a little bit different from a standard warning (which will show up just fine by default).
scala编译器中发生了一个功能警告;这就是有1个功能警告"消息的来源.
There's a feature warning happening in the scala compiler; that's where that "there were 1 feature warning(s)" message comes from.
您需要将-feature作为scalacOptions的一部分传递到scalac中,这可以通过在Build.scala中添加以下内容来实现:
You need to pass -feature into scalac as part of scalacOptions which can be done by adding something like the following to your Build.scala:
val main = play.Project(appName, appVersion, appDependencies).settings(
scalacOptions += "-feature"
)
这篇关于Play Framework编译发出警告,如何查看警告?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!