Flavors

There is more than just one version of Turbine. You might have to build one application using a released version of Turbine (currently 2.3.2) and the next should use a developer version or even a "bleeding edge" snapshot release of the Turbine code. Whatever you want to use, the M.E.T.A. plugin helps you selecting the right skeleton for your code.

Selecting Flavors

The default flavor for a new application in ad hoc setup mode is the current stable Turbine release ("turbine-2.3.2"). If you want to use a different flavor, you must either supply it on the command line or in your setup.properties file.

Generate a Turbine 2.3 skeleton:

maven -Dturbine.app.name=<application name> -Dturbine.app.flavor=turbine-2.3 turbine:setup

Adding your own flavors

This is a section for advanced users that are reasonably familiar with maven and the Turbine framework. If you're just starting to use Turbine and M.E.T.A., you can skip this section.

Flavors are built from templates in the flavor subdirectory of the M.E.T.A. plugin. If you want to add a new flavor, you must modify the plugin source and then rebuild and deploy the plugin to your maven installation.

The plugin source contains a subdirectory src/plugin-resources/flavor. Here are the setup files for each flavor stored, that are used by the turbine:setup goal. Each flavor has its own subdirectory which can in turn contain the following directories:

PathDescription
mavenFiles for the application setup.
confTurbine configuration file.
schemaSchema files for Application and Security OM classes.
templatesDefault templates for your application.
imagesImages to be copied into your application.
resourcesGeneral resources needed for your application.
pagesOther files, e.g. HTML pages, that should be put into your application root.
propsFiles that should go in the application classpath (the WEB-INF/classes directory). e.g. the commons-logging.properties that can be used with Turbine 2.3.1 and beyond.
There is also a directory called common which contains files that are the same for all flavors.

turbine:setup copies all the files from the common directory into the new application skeleton and then the files from the respective flavor directory. Files from the latter will overwrite files from the common tree.

Subdirectories can be omitted if there are no flavor specific files.

To add a new flavor, you must add at least a flavor specific maven subdirectory as flavor/<your flavor name>/maven which contains the template for the maven POM (project.xml).

The tricky part of setting up a new flavor happens when you do not need a file from the common directory for your new flavor. In that case, you must copy this file from the common sub-tree into all other flavors and then remove it from there.