0

除非我遗漏了什么,否则 Play mini 根本不像一个游戏项目。它在 sbt 中运行,你不能使用 play 命令。

https://github.com/typesafehub/play2-mini

那么如何将这些东西部署到生产环境中呢?我也尝试过一个罐子和组装,但它对我不起作用

我尝试了 start-script/stage 方法,但它似乎找不到我的主类:

sbt
>add-start-script-tasks
>stage

[info] Wrote start script for mainClass := None to /Users/rmedlin/rtbv2/target/start

这是我的 Build.scala。我也尝试过:mainClass in (Compile, stage, run)等多种组合

object Build extends Build {
  override lazy val settings = super.settings
  lazy val root = Project(id = "rtbv2", 
base = file("."), settings = Project.defaultSettings).settings(
  resolvers += "Typesafe Repo" at "http://repo.typesafe.com/typesafe/releases/",
  resolvers += "Typesafe Snapshot Repo" at "http://repo.typesafe.com/typesafe/snapshots/",
  libraryDependencies += "com.typesafe" %% "play-mini" % "2.0.1",
  mainClass in (Compile, run) := Some("play.core.server.NettyServer"))
}
4

1 回答 1

1

我的 Build.scala 不正确,我能够使汇编命令正常工作:

trait ConfigureScalaBuild {


lazy val typesafe = "Typesafe Repository" at "http://repo.typesafe.com/typesafe/releases/"

lazy val typesafeSnapshot = "Typesafe Snapshots Repository" at "http://repo.typesafe.com/typesafe/snapshots/"

val netty = Some("play.core.server.NettyServer")

def scalaMiniProject(org: String, name: String, buildVersion: String, baseFile:         java.io.File = file(".")) = Project(id = name, base = baseFile, settings =      Project.defaultSettings ++ assemblySettings).settings(
 version := buildVersion,
 organization := org,
 resolvers += typesafe,
 resolvers += typesafeSnapshot,
 logManager <<= extraLoggers(com.typesafe.util.Sbt.logger),
 libraryDependencies += "com.typesafe" %% "play-mini" % "2.0.1",
 mainClass in (Compile, run) := netty,
 mainClass in assembly := netty,
 ivyXML := <dependencies> <exclude org="org.springframework"/> </dependencies>
)
}
于 2012-11-27T23:29:15.107 回答