Turbine-Maven How-To

[Warning]Warning

This document is, in my opinion, obsolete. The META plugin is a much better solution!

Creating a Turbine Web Application using Turbine 2.3.1 and Maven

Right now these are just my notes for the steps that I have used in my attempts to make things work, but this should evolve into a How-To.

System Requirements

I am using Mac OS X 10.2.8 with Java version 1.4.1_01-69.1, but this procedure should work on any (UNIX based?) platform with a JVM that is supported by Turbine and Maven.

Installing Maven

Install Maven version 1.0-rc1 using the following steps:

  • Download the archive

  • Unpack in ~/maven or /usr/local/maven, etc.

  • Make sure your JAVA_HOME is set correctly

  • Set MAVEN_HOME to point to the directory you put Maven into

  • Add $MAVEN_HOME/bin to your path.

For additional information see: Getting Started with Maven and Developing with Maven.

Checkout and Build the latest source from the Turbine 2.3 Branch

This section needs more detail, and should eventually be optional, since in Turbine 2.3.x, Maven should be able to automatically install the Turbine binaries.

(These notes are for the 2.3 branch as of Dec. 14th, 2004.)

Use the maven jar:install command to build Turbine and install in the local repository. I ran into two problems that required manual intervention:

  1. Henning's post detailing a change to build.properties required by a bug in Maven beta-10 seems to still apply to 1.0-rc1.

  2. Maven will report that a handful of jars from SUN, must be manually downloaded. You'll need to manually download these and put them in your local Maven repository

Build/Install the Maven-Turbine Plugin

The source for the Maven-Turbine plugin is in the Turbine 2.3 module. (This section needs detail and double-checking.)

  • cd src/maven-plugin

  • maven plugin:install

Download and Install the 2.3.1 TDK

I used Jeff Painter's latest TDK, available here.

I had to make a couple tweaks to get newapp to build, and I forgot to take notes (sorry.)

One tweak I do remember is that I had to update the DOCTYPE declaration in dtd/intake.dtd to a full path (there probably is a better solution for this...)

Initialize a Turbine WebApp Project Directory

  • mkdir xyz/myturbineapp

  • cd xyz/myturbineapp

  • maven -D package=com.myco.myapp turbine:sample

  • Update the template project.xml with your project information.

  • Type maven site:generate to create the site documentation

    You may need to add a reports section to project.xml and disable any reports that are not working yet (e.g. if you haven't setup CVS, etc.)

There is documentation on the Maven Turbine plug-in in the 2.4 section of the Turbine site, that seems to apply equally to the 2.3 Maven-plugin.

Copy files from TDK

Since the maven turbine:sample goal is incomplete, you must manually copy files from the TDK directory into the project directory setup by Maven. The documentation for this process should become the specifcation for the additional steps to be performed by the turbine:sample Maven goal.

  • Copy TDK/webapps/newapp/templates/flux to PROJ/src/webapp/templates

  • Copy TDK/webapps/newapp/templates/app to PROJ/src/webapps/templates

  • Copy TDK/webapps/newapp/WEB-INF/src/java/com to PROJ/src/java/

    You should probably delete the java/com/myco/newapp/om/* files since they should be generated.

  • Copy TDK/webapps/newapp/WEB-INF/src/sql to PROJ/src/sql (all generated?)

  • Copy TDK/webapps/newapp/WEB-INF/build to PROJ/build

  • Copy TDK/webapps/newapp/WEB-INF/conf/* to PROJ/src/webapps/conf (merge Torque and Turbine .properties files?)

  • Change the tdk.home setting in PROJ/build/build.properties to the correct full path

  • Steps 1-6 in Wordman's How-To Adjust Properties section.

  • Adjust path to database_3_1.dtd in src/webapp/conf/newapp-schema.xml (use fullpath)

  • Skip Wordman's "Prepare for Database Expansion" and "Defining New Tables" as we should (?) be getting this for free in Turbine/TDK 2.3

  • Removed targets from PROJ/build/build.xml as suggested by Wordman in "Additional Maven Integration"

  • Created maven.xml as suggested by Wordman

  • Had substitue @ tags in src/webapp/WEB-INF/web.xml - why?

  • Added dependencies to project.xml (copied from turbine)

  • Marked dependencies that should go in WEB-INF/lib

This procedure is derived from Wordman's How-To that has been posted to the Turbine Wiki.

Deploying to Tomcat

  • Download the Maven Tomcat Plugin (why isn't this on the Maven site as an optional Maven plugin?)

  • Unzip, remove the extend element from project.xml, and type maven plugin:deploy

  • Add properties to build.properties


Creative Commons License
This work is licensed under a Creative Commons License.