---
title: "How to run a Play Framework Application in Tomcat or JBoss"
date: 2013-12-06T22:38:25+00:00
author: "poornerd"
tags: ["glassfish", "jboss", "tomcat", "war"]
canonical: https://www.poornerd.com/2013/12/06/how-to-run-a-play-framework-application-in-tomcat-or-jboss/
source: Raw Markdown twin of the HTML article; content is the original source.
---
So you have written an application using Play! Framework 2.x and your System Administrator tells you that he won&#8217;t install Play! and that your application needs to run in a supported Java Servlet Container like JBoss, Tomcat or Glassfish?

No worries, you can use the <a href="https://github.com/dlecan/play2-war-plugin" onclick="javascript:pageTracker._trackPageview('/outbound/article/github.com');" target="_blank">play2-war-plugin</a> to create a WAR file which can be deployed in a Java Servlet 2.5 or 2.3 spec Servlet Container!

Here is the Quick Guide for 2.1.x (mainly from <a href="http://stackoverflow.com/questions/17344896/how-to-install-play2war-plugin-play-framework-2-1-1" onclick="javascript:pageTracker._trackPageview('/outbound/article/stackoverflow.com');" target="_blank">stackoverflow</a>):

  1. Within plugins.sbt add: <pre class="brush: plain; title: ; notranslate" title="">addSbtPlugin("com.github.play2war" % "play2-war-plugin" % "1.1.1")</pre>
    
    According to the project web page, you will need to pick the correct Version for you Play! Framework version:
    
    <pre>Play 2.0 -> 2.0.4 : 0.8.1
    Play 2.0.5+       : 0.8.2
    Play 2.1 -> 2.1.3 : 1.0.1
    Play 2.1.4+       : 1.1.1
    Play 2.2.x        : 1.2-beta1 (unstable)
</pre>

  2. Then within the Build.scala file add: <pre class="brush: plain; title: ; notranslate" title="">import com.github.play2war.plugin._
...
.settings(Play2WarPlugin.play2WarSettings: _*)
.settings(Play2WarKeys.servletVersion := "X.X")
</pre>
    
    _The X.X needs to be changed to the required Java Servlet version (usually 3.0 or 2.5 depending on your container)_ </li> </ol> 
    
    If you are using Play! Framework 2.2 then you can also try this method without the Plugin, just using sbt <a href="http://play2war.blogspot.in" onclick="javascript:pageTracker._trackPageview('/outbound/article/play2war.blogspot.in');" target="_blank">http://play2war.blogspot.in</a>.
