Play app deployment guide

来自开放百科 - 灰狐
2016年5月27日 (五) 10:05Allen (讨论 | 贡献)的版本

跳转到: 导航, 搜索

Play 应用部署指南

指南

play new playwebapp

build.sbt

name := "playwebapp"
version := "1.0-SNAPSHOT"
libraryDependencies ++= Seq(
  jdbc,
  anorm,
  cache
)   

project/plugins.sbt

logLevel := Level.Warn
resolvers += "Typesafe repository" at "http://repo.typesafe.com/typesafe/releases/"
resolvers += Resolver.url(
  "bintray-sbt-plugin-releases",
   url("http://dl.bintray.com/content/sbt/sbt-plugin-releases"))(
       Resolver.ivyStylePatterns)
addSbtPlugin("com.github.play2war" % "play2-war-plugin" % "1.2.1")
addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.2.4")

project/Build.scala

import sbt._
import Keys._
import play.Project._
import com.github.play2war.plugin._
object ApplicationBuild extends Build {
val appName = "playwebapp"
val appVersion = "1.0-SNAPSHOT"
val appDependencies = Seq(
// Add your project dependencies here,
javaCore,
javaJdbc,
javaEbean
 )
val main = play.Project(appName, appVersion, appDependencies)
.settings(Play2WarPlugin.play2WarSettings: _*)
.settings(
Play2WarKeys.servletVersion := "3.1"
 )
}

打包 $ play war

target目录下:playwebapp-1.0-SNAPSHOT.war

项目

链接

分享您的观点
个人工具
名字空间

变换
操作
导航
工具箱