我是 LIFT 新手,我正在尝试找到如何分别使用 Maven 和 sbt 生成和管理 LIFT Web 项目的可靠说明。有人可以指导我(或在此处提供)如何为 Maven 生成的项目设置 sbt 的最新说明吗?从我红色的每一篇文章来看,它看起来像是 LIFT 项目的最佳设置:使用 mvn 生成,使用 sbt 管理。你会同意吗? (我无法使用 sbt 生成 LIFT/web 项目。对吗?SBT 只适合管理它。对吗?)不过,我尝试的每条指令都已过时。 (显然我可以简单地下载并解压原型(prototype)项目,但我想找到一种更基本的方法来管理环境)谢谢。
最佳答案
当我使用 lift 时,我根本不需要专家,只需要 SBT。因此,阅读 SBT Getting Started 非常有用。部分。另外 Lift wiki 包含一些 information 。但请确保您阅读了与正确的 SBT 版本相关的 Material 。最后,大家可以关注我的lift project template在 github 上。
祝电梯好运!太棒了;)
通过遵循您评论中的问题,我在此处放置了我的项目中的一些常见配置。
因此,这是 ./project/build.scala
作为 ./build.sbt
import sbt._
import Keys._
import com.github.siasia._
import PluginKeys._
import WebPlugin._
import WebappPlugin._
object LiftProjectBuild extends Build {
override lazy val settings = super.settings ++ buildSettings
lazy val buildSettings = Seq(
organization := "com.yourorganization",
version := "0.1-SNAPSHOT",
scalaVersion := "2.9.1")
def yourWebSettings = webSettings ++ Seq(
// If you are using jrebel
scanDirectories in Compile := Nil
)
lazy val shade = Project(
id = "project-name",
base = file("."),
settings = defaultSettings ++ yourWebSettings)
lazy val defaultSettings = Defaults.defaultSettings ++ Seq(
name := "project-name",
resolvers ++= Seq(
"Typesafe Repo" at "http://repo.typesafe.com/typesafe/releases",
"Java.net Maven2 Repository" at "http://download.java.net/maven/2/"),
libraryDependencies ++= {
val liftVersion = "2.4-M5"
Seq(
"net.liftweb" %% "lift-webkit" % liftVersion % "compile",
"org.eclipse.jetty" % "jetty-webapp" % "7.5.4.v20111024" % "container",
"org.squeryl" %% "squeryl" % "0.9.5-SNAPSHOT" % "compile",
"ch.qos.logback" % "logback-classic" % "1.0.0" % "compile",
"org.scalatest" %% "scalatest" % "1.6.1" % "test",
"junit" % "junit" % "4.10" % "test")
},
// compile options
scalacOptions ++= Seq("-encoding", "UTF-8", "-deprecation", "-unchecked"),
javacOptions ++= Seq("-Xlint:unchecked", "-Xlint:deprecation"),
// show full stack traces
testOptions in Test += Tests.Argument("-oF")
)
}
./project/build.properties
#Project properties
sbt.version=0.11.1
./project/plugins.sbt
resolvers += Classpaths.typesafeResolver
addSbtPlugin("com.typesafe.sbteclipse" % "sbteclipse" % "1.5.0")
libraryDependencies <+= sbtVersion(v => "com.github.siasia" %% "xsbt-web-plugin" % (v+"-0.2.10"))
拥有这三个文件足以配置 sbt。
当然,您可以通过调用 container:start
关于scala - LIFT 设置 Web 项目 : generate with mvn, 并使用 sbt 进行管理,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8263300/