Configuring Play2War with Play 2.2 and build.sbt

Posted by Brian Porter on March 13, 2014

Screen Shot 2014-03-13 at 21.07.45I had previously used Play2War with Play 2 projects that contained a Build.scala file following the configuration directions from Play2War. However, when attempting to configure a newer project which now uses a build.sbt instead of the Build.scala, It wasn’t immediately apparent how to do it.

  1. Add this to your plugins.sbt: addSbtPlugin(“com.github.play2war” % “play2-war-plugin” % “1.2-beta4”)
  2. Add this to the top of your build.sbt: <pre class="brush: plain; title: ; notranslate" title=""> import com.github.play2war.plugin._</pre>

  3. Add this at the end of your build.sbt: (yes with the line between them, and the servlet Version you need).  <pre class="brush: plain; title: ; notranslate" title="">Play2WarPlugin.play2WarSettings Play2WarKeys.servletVersion := “2.5”</pre>

  4. Run “play war” and when it is done, look in the target directory