【问题标题】:How to run a Lift-2.4 web app with sbt如何使用 sbt 运行 Lift-2.4 网络应用
【发布时间】:2013-04-11 07:06:02
【问题描述】:

我正在尝试按照本教程 http://scala-ide.org/docs/tutorials/lift24scalaide20/index.html 运行 Lift-2.4 网络应用程序

问题是如何运行这个应用程序(在码头、tomcat 或其他服务器上)?!

我正在尝试命令 jetty-run,但出现此错误:

> jetty-run

[error] Not a valid command: jetty-run
[error] Expected '/'
[error] Expected ':'
[error] Not a valid key: jetty-run (similar: run)
[error] jetty-run
[error]          ^

当我执行容器:启动时,我也遇到了错误:

> container:start

[error] Not a valid key: start (similar: state, target, start-year)
[error] container:start
[error] 

           ^

我的配置是:

文件“build.sbt”包含:

name := "lift-basic"

organization := "my.company"

version := "0.1-SNAPSHOT"

scalaVersion := "2.9.1"

EclipseKeys.createSrc := EclipseCreateSrc.Default + EclipseCreateSrc.Resource

libraryDependencies ++= {
val liftVersion = "2.4"
Seq(
"net.liftweb" %% "lift-webkit" % liftVersion % "compile",
"net.liftweb" %% "lift-mapper" % liftVersion % "compile",
"org.mortbay.jetty" % "jetty" % "6.1.26" % "test",
"junit" % "junit" % "4.7" % "test",
"ch.qos.logback" % "logback-classic" % "0.9.26",
"org.scala-tools.testing" %% "specs" % "1.6.9" % "test",
"com.h2database" % "h2" % "1.2.147"
)
}

并且文件“.sbt/plugins/build.sbt”包含:

//Eclipse Plugin

resolvers += Classpaths.typesafeResolver

addSbtPlugin("com.typesafe.sbteclipse" % "sbteclipse-plugin" % "2.0.0")

【问题讨论】:

    标签: eclipse scala jetty sbt lift


    【解决方案1】:

    听起来你需要为sbt 安装xsbt-web-plugin 插件。

    此处提供说明:https://github.com/JamesEarlDouglas/xsbt-web-plugin/wiki

    这应该为您提供container:start 以及 jar 包装。

    【讨论】:

    • 另外,我建议使用电梯应用程序的主要“起点”:github.com/lift/lift_25_sbt 它是最新的并且可以正常工作。
    • 事实上,我的问题集中在 Lift-2.4 上,因为在教程中他们说使用以下命令部署您的应用程序:jetty-run 但对我来说它不起作用?!对于 Lift-2.5,它适用于 container:start
    猜你喜欢
    • 2011-11-28
    • 1970-01-01
    • 2011-11-09
    • 2013-05-20
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-04-11
    • 2012-01-07
    相关资源
    最近更新 更多