Thursday, June 28, 2012

Upgrade from Play 2.0.1 to 2.0.2

Say you have a project in Play 2.0.1, but guess what? There is a new (minor) version out there that might just fix a bug you care about. How do you go about upgrading?
Well, first you need to download the new Play 2.0.2 framework and replace the old one. Then, you need to edit a couple files in  your project in order to make it compatible:

  • edit [appName]/project/build.properties and change sbt version from 0.11.2 to 0.11.3. Like this:
    sbt.version=0.11.3
  • edit [appName]/project/plugins.sbt and change the version of play from 2.0.1 to 2.0.2. Like this:
    addSbtPlugin("play" % "sbt-plugin" % "2.0.2")
That's it! Now launch play again and you should see that it updates a bunch of libraries and then its' ready.
Additionally if you are using Eclipse IDE, you might need to re-eclipsify your app in order to fix the Eclipse project classpath to point to the new 2.0.2 directory.

Friday, May 25, 2012

Play2 Port Change

Play 2.0.1 defaults the port to 9000. But if you want to develop more that one app at a time you need to be able to change the port. Googling this you'll find the recommendation for typing in command line:
play "run 9001"
But this does not work in Windows. Until they fix this you need to do this in two steps. First enter the Play console with a simple:
play
then while in the Play console you can run the application with the port of your choice:
[appName] $ run 9001