【问题标题】:play2-scalate publish-local errorplay2-scalate 发布本地错误
【发布时间】:2013-02-01 17:01:40
【问题描述】:

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

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

版本:Play 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

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

【问题讨论】:

    标签: playframework-2.0 scalate


    【解决方案1】:

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

    解决方案是修改 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")
    

    希望这会有所帮助。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-07-02
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多