2

我正在尝试使用 play2-scalate 插件 ( https://github.com/adetante/play2-scalate ) 在我的 Play 框架应用程序中利用 Jade 模板,但在尝试运行“play publish-local”时遇到错误.

在我提出问题之前,我想我会在这里检查一下是否有一个简单的解决方法(我是 Play/Scala/Scalate 的新手)。提前感谢您提供的任何帮助。

版本:播放 2.1-RC1、sbt 0.12.0、scala-2.10.0

说明是play > publish-local在项目核心目录中运行,这是我得到的错误:

[info] Generating Scala API documentation for main sources to /tools/play2-scalate/project-code/target/scala-2.10/api...
[error] /tools/play2-scalate/project-code/app/controllers/Template.scala:21: not enough arguments for constructor TemplateEngine: (sourceDirectories: Traversable[java.io.File], mode: String)org.fusesource.scalate.TemplateEngine
[error] /tools/play2-scalate/project-code/app/controllers/Template.scala:21: not enough arguments for constructor TemplateEngine: (sourceDirectories: Traversable[java.io.File], mode: String)org.fusesource.scalate.TemplateEngine
[error]   val engine:TemplateEngine=new TemplateEngine()
[error]   val engine:TemplateEngine=new TemplateEngine()
[error]                             ^
[error]                             ^
[info] No documentation generated with unsucessful compiler run
[error] one error found
[error] one error found
[error] (compile:doc) Scaladoc generation failed

看起来它在文档生成步骤上失败了;我不知道如何解决这个问题。任何建议表示赞赏。谢谢!

4

1 回答 1

2

似乎与使用 scala 2.9 和 2.10 构建的库在默认参数方面存在二进制不兼容;请参阅: Scala 2.10.0 RC2 和可选参数

解决方案是修改project-code/project/Build.scala以将 scalate 依赖项设置为"scalate-core_2.10" % "1.6.1"

object ApplicationBuild extends Build {

  val appName         = "play2-scalate"
  val appVersion      = "0.1-SNAPSHOT"

  val appDependencies = Seq(
    "org.fusesource.scalate" % "scalate-core_2.10" % "1.6.1"
  )

  val main = PlayProject(appName, appVersion, appDependencies, mainLang = SCALA).settings(
  )

}

/project需要对文件进行其他更改:

/project-code/project/build.properties
    -sbt.version=0.11.2
    +sbt.version=0.12.2

/project-code/project/plugins.sbt
    // Use the Play sbt plugin for Play projects
    -addSbtPlugin("play" % "sbt-plugin" % "2.0.1")
    +addSbtPlugin("play" % "sbt-plugin" % "2.1.0")

希望这可以帮助。

于 2013-02-15T01:56:02.680 回答