所有
我使用play framevork项目。 我想在tomcat服务器上运行我的项目 我有问题创建战争文件使用Play2War。 使用Play 2.4.2版本。
plugins.sbt
// Comment to get more information during initialization logLevel := Level.Warn
// The Typesafe repository resolvers += "Typesafe repository" at "http://repo.typesafe.com/typesafe/releases/"
// Use the Play sbt plugin for Play projects addSbtPlugin("com.typesafe.play" % "sbt-plugin" % Option(System.getProperty("play.version")).getOrElse("2.4.0"))
addSbtPlugin("com.typesafe.sbt" %% "sbt-play-ebean" % "1.0.0")
resolvers += "Play2war plugins release" at "http://repository-play-war.forge.cloudbees.com/release/"
addSbtPlugin("com.github.play2war" % "play2-war-plugin" % "1.4-beta1")
// TODO: find a way to automatically load sbt plugins of projects we depend on // if you see this and know how to do it, please open a pull request :)
// Uncomment the next line for local development of the Play Authentication core: //addSbtPlugin("com.jsuereth" % "sbt-pgp" % "1.0.0")
// Uncomment the next line for local development of the Play Authentication core: //addSbtPlugin("com.github.gseitz" % "sbt-release" % "0.8.5")
addSbtPlugin("com.typesafe.sbt" % "sbt-play-enhancer" % "1.1.0")
addSbtPlugin("com.typesafe.sbt" % "sbt-less" % "1.0.0")
build.sbt
import com.github.play2war.plugin._
organization := "myhome"
name := "myapp"
scalaVersion := "2.11.6"
version := "1.0-SNAPSHOT"
resolvers += "Play2war plugins release" at "http://repository-play-war.forge.cloudbees.com/release/"
addSbtPlugin("com.github.play2war" % "play2-war-plugin" % "1.4-beta1")
Play2WarPlugin.play2WarSettings
// Servlet version compatible with Tomcat 7
// See https://github.com/play2war/play2-war-plugin#server-compatibility
Play2WarKeys.servletVersion := "3.0"
val appDependencies = Seq(
"be.objectify" %% "deadbolt-java" % "2.4.0",
// Comment the next line for local development of the Play Authentication core:
"com.feth" %% "play-authenticate" % "0.7.0-SNAPSHOT",
"org.postgresql" % "postgresql" % "9.4-1201-jdbc41",
cache,
javaWs,
javaJdbc,
"org.abstractmeta" % "compilation-toolbox" % "0.3.3",
"org.reflections" % "reflections" % "0.9.9-RC1",
"org.beanshell" % "bsh" % "2.0b5",
"org.webjars" % "jquery" % "2.1.4",
"org.webjars" % "bootstrap" % "3.3.5" exclude("org.webjars", "jquery"),
"org.easytesting" % "fest-assert" % "1.4" % "test"
)
// add resolver for deadbolt an d easymail snapshots
resolvers += Resolver.sonatypeRepo("snapshots")
// Uncomment the next line for local development of the Play Authenticate core:
//lazy val playAuthenticate = project.in(file("modules/play-authenticate")).enablePlugins(PlayJava)
lazy val root = project.in(file("."))
.enablePlugins(PlayJava, PlayEbean)
.settings(
libraryDependencies ++= appDependencies
)
/* Uncomment the next lines for local development of the Play Authenticate core: */
//.dependsOn(playAuthenticate)
//.aggregate(playAuthenticate)
includeFilter in (Assets, LessKeys.less) := "*.less"
// for minified *.min.css files
LessKeys.compress := true
fork in run := true
错误:
[error] (*:update) sbt.ResolveException: unresolved dependency: com.github.play2war#play2-war-plugin;1.4-beta1: not found
[error] Total time: 12 s, completed 07.08.2015 1:33:14
我做错了什么?
请帮助我
答案 0 :(得分:0)
你正在混淆。
将addSbtPlugin(...)
的所有实例保存在plugins.sbt中,将所有resolvers += ...
实例保存在build.sbt上。还尝试将它们组织在一起,看看它是如何进行的。