Since the support for building a war is not available for play application after Play 2.1.4, there is a workaround which can help you get over this problem. Follow the following steps very carefully :-
1. Create Build.scala(can be copied from earlier versions of play application).
// dont use this file to run project - use build.sbt (only to create a war)
(Comment this file when running the application)
import sbt._
import Keys._
import play.Project._
import com.github.play2war.plugin._
object ApplicationBuild extends Build {
val appName = "Test_App"
val appVersion = "1.0-SNAPSHOT"
val appDependencies = Seq(
// Add your project dependencies here,
jdbc,
anorm
)
val main = PlayProject(appName, appVersion, appDependencies, mainLang = JAVA)
.settings(Play2WarPlugin.play2WarSettings: _*)
.settings(
Play2WarKeys.servletVersion := "3.0"
)
}
2. Comment all the lines from build.sbt (originally available in project) (Make sure to uncomment when you want to run the application)
3. Make changes according to following sample in plugins.sbt :-
// For running project, comment at the time of making war.