I always thought the joy of reading a book is not knowing what happens next.

I have joined Anti-IF Campaign
Nov 5 ’09

PlayFramework recipe: Automation with Maven and Hudson

In a previous post I said that one of the cons of Play Framework was the lack of Maven support. Play has itself a little CI engine. But I need to check releases and I want to do it in a clean and  ”standard” environment. I’m not a big maven fan, but it is a valuable component of the life of all my project. With Hudson. Creating a Hudson job from a pom file is a metter of seconds. It ensure the consistency of each build and the quality of the software product under development. So I have written this pom suitable for a play project.

Dependency discovery was quite tricky since play gives you the jar needed for deployment without specific version numbering.

  • I added the maven-dependency-plugin to copy all the jar in the lib folder
  • the maven-compiler-plugin to support jdk 1.6 features needed by play
  • the build-helper-maven-plugin is essential to ad multiple source folders to a single maven module. You have to add a source folder for each play module used
  • I added also the maven-pmd-plugin to check the code quality trough Hudson
  • sourceDirectory point to app directory of the play project
  • testSourceDirectory point to test directory of the play project (only junit style test will be executed)

I defined the new Hudson Job as a maven job. Optional goals (pmd:pmd) must be defined manualy.

Once the Job is up and running Hudson will compile your classes, check the code style and execute the test: functional test needs to point to a running version of your app at the same version you are building in Hudson.

and with proper Hudson plug-in you can also have fancy Jabber IM conversation with Hudson about the build status…

I love it when a plan comes together!

5 notes

  1. ikeikeredking reblogged this from sammyrulez
  2. sammyrulez posted this