【发布时间】:2015-09-02 08:33:27
【问题描述】:
我正在尝试将 Webjars Bootstrap 用于 Scala Play,但我遇到了关于 Webjars 本身的编译错误。
我遵循http://www.webjars.org/documentation 和How to use Twitter Bootstrap 2 with play framework 2.x 中的方法;我正在使用 scala play 2.4.2。我的错误是:
Compilation error
error while loading WebJarAssets, class file
'/home/ubuntu-prod/.ivy2/cache/org.webjars/webjars-play_2.10/jars/webjars-play_2.10-2.4.0-1.jar(controllers/WebJarAssets.class)'
is broken (class java.lang.RuntimeException/Scala class file does not contain Scala annotation)
我尝试修复此错误的方法:
- 删除并重新下载
/home/ubuntu-prod/.ivy2/cache/org.webjars/webjars-play_2.10/jars/webjars-play_2.10-2.4.0-1.jar中的jar - 添加其他依赖项,遵循class java.lang.RuntimeException/Scala class file does not contain Scala annotation 中的类似问题
mu build.sbt 是:
[...]
libraryDependencies ++= Seq(
"org.scalatest" %% "scalatest" % "2.2.4" % "test",
"org.webjars" %% "webjars-play" % "2.4.0-1",
"org.webjars" % "bootstrap" % "3.1.1-2",
"org.webjars" % "bootswatch-cerulean" % "3.3.1+2",
"org.webjars" % "html5shiv" % "3.7.0",
"org.webjars" % "respond" % "1.4.2"
)
[...]
我的路线是:
GET / controllers.Application.index
# Map static resources from the /public folder to the /assets URL path
GET /assets/*file controllers.Assets.at(path="/public", file)
GET /webjars/*file controllers.WebJarAssets.at(file)
没有 Webjars,没有编译错误...
有什么办法可以解决这个问题吗?
谢谢!
【问题讨论】:
标签: playframework