容器:开始在Scalatra sbt项目中停止工作:"无效密钥"

时间:2015-10-06 06:38:04

标签: scala sbt scalatra

我使用giter8以标准方式构建了一个scalatra项目。

我不确定为什么容器:在我的scalatra项目中不再起作用:build.sbt没有改变。这是错误:

Using /home/stephen/.sbt/0.12.0 as sbt dir, -sbt-dir to override.
[info] Set current project to wfdemo (in build file:/home/stephen/wfdemo/)
> container:start
[error] Not a valid key: start (similar: state, startYear, target)
[error] container:start
[error]

这是sbt:

object KeywordsservletBuild extends Build {
  val Organization = "com.astralync"
  val Name = "KeywordsServlet"
  val Version = "0.1.0-SNAPSHOT"
  val ScalaVersion = "2.11.7"
  val ScalatraVersion = "2.4.0-RC2-2"

  lazy val project = Project (
    "keywordsservlet",
    file("."),
    settings = ScalatraPlugin.scalatraSettings ++ scalateSettings ++ Seq(
      organization := Organization,
      name := Name,
      version := Version,
      scalaVersion := ScalaVersion,
      resolvers += Classpaths.typesafeReleases,
      resolvers += "Scalaz Bintray Repo" at "http://dl.bintray.com/scalaz/releases",
      libraryDependencies ++= Seq(
        "org.apache.spark" %% "spark-core" % "1.3.1",
        "org.scalatra" %% "scalatra" % ScalatraVersion,
        "org.scalatra" %% "scalatra-scalate" % ScalatraVersion,
        "org.scalatra" %% "scalatra-specs2" % ScalatraVersion % "test",
        "ch.qos.logback" % "logback-classic" % "1.1.2" % "runtime",
        "org.eclipse.jetty" % "jetty-webapp" % "9.2.13.v20150730" % "container",
        "javax.servlet" % "javax.servlet-api" % "3.1.0" % "provided",
        "net.databinder" % "unfiltered-netty_2.11" % "0.8.4"
      ),
      scalateTemplateConfig in Compile <<= (sourceDirectory in Compile){ base =>
        Seq(
          TemplateConfig(
            base / "webapp" / "WEB-INF" / "templates",
            Seq.empty,  /* default imports should be added here */
            Seq(
              Binding("context", "_root_.org.scalatra.scalate.ScalatraRenderContext", importMembers = true, isImplicit = true)
            ),  /* add extra bindings here */
            Some("templates")
          )
        )
      }
    )
  )
}

建议表示赞赏。

1 个答案:

答案 0 :(得分:-1)

小但不一定明显的解决方法:

; container:start ; shell

需要使用前导分号。