Archetype Plugin


The archetype plugin should be used to generate new equanda project from template.

It can be executed by the following command (all on one line) :

mvn equanda:archetype
-DgroupId=com.mycompany -DartifactId=example
-DarchetypeVersion=0.9.4 -DarchetypeGroupId=org.equanda -DarchetypeArtifactId=equanda-maven-plugin

All the parameters on the last line are used internally by maven.

The other parameters can either be specified on the commandline using the "-Dkey=value" syntax, or you can put them in a file called "". This file itself can be changed by using something like "".

Possible parameters (those in bold are required) are :

  • groupId : project group id
  • artifactId : project base artifact id
  • archetypeVersion : equanda archetype plugin version
  • archetypeGroupId : equanda archetype plugin group id, has to be "org.equanda"
  • archetypeArtifactId : equanda archetype plugin artifact id, has to be "equanda-maven-plugin"
  • basedir : base project directory (default is current directory)
  • remoteRepositories : remote repositories, comma separated values
  • packageName : default java package, defaults to the "groupId" value
  • version : new project version (default is "1.0-SNAPSHOT")

For details see Maven Archetype Plugin Page.


The archetype creates an empty project with the equanda "standard" modules (as also used by the test suite, equanda-contact and equanda-sport example projects).

main module

The main project groups the other modules to allow one entry point into the project.

  • The domain model should be placed in the "src/dm" directory. There is a very small sample domain model generated.
  • Basis for the project site under "src/site". This contains a "getting started" document which details information to compile the project, how to setup a database for development etc.
  • The "config" directory contains a checkstyle configuration.

This includes two profiles which help you for development and testing.

  • use "mvn -Drun install" or "mvn -Drun clean install" to compile, install the application and start jboss with the latest version installed. This allows you to manually verify the correct working, especially the user interface. Once jboss is started this will just wait for jboss to end (to press CTRL-C in the console window when finished). The database structure is updated before starting the application.
  • use "mvn -Dfulltest clean install" to do a clean compile and installation, including running the integrations tests from the test module starting from and empty (or more correctly "known" database). The database structure is updated before starting the application.

Apart from the usual maven targets, the following (standard equanda) targets can be applied to the project.

  • "mvn equanda:translate" to edit the translations file.
  • "mvn equanda:ddltool" to update the database structure.

core module

The core module builds a jar file which contains the EJB classes, including the database access layer, mediators etc.

  • The persistence.xml file, configuring the EJB3/JPA entity beans is in "src/main/resources/META-INF/persistence.xml".
  • The base translations file can be found in "src/main/resources/translations.txt". Use "mvn equanda:translate" to edit this file.
  • There are a couple of example mediator files in "src/main/java/".

gui module

The gui module builds the war file with the tapestry web user interface for the application.

  • In "src/main/java" you can find some proposed layout components, a start page and the AppModule class which configures Tapestry.
  • In "src/main/resources" you can find some Tapestry templates for the pages and components.
  • The AppModule class includes a service for timing the time takes for each page invocation (can be removed).
  • The AppModule class includes a service for getting the login information (which includes the authorizations for the data in the interface).
  • In "src/main/webapp" you can find resources (css/images/script) and the servlet configuration files ("WEB-INF/web-xml" and "WEB-INF/jboss-web.xml").

ear module

The ear module builds the ear file which combines the core jar, the gui war and all libraries which need to be included for deploying in JBoss.

t5compo module

The t5compo module is used for defining and including customizations to the generated user interface.

  • The "src/main/resources/t5gui/mytemplates/" file contains the template overrides.
  • The "src/main/resources/t5gui/mytemplates/example.tml.vm" file contains an example changed template.

ddltool module

This module is used to generate the database description file which used by the "equanda:ddltool" maven target and when doing the database update when deploying in JBoss or running the integration tests.

test module

This is the integration test module. All the test class included in this modul are only included in the build phase when the "fulltest" profile is active. This will assure that the application is running (inside JBoss, starting from an empty database with database structure update) when the tests are run.

  • 1. Archetype Plugin
  • 1.1. Usage
  • 1.2. Features
  • 1.2.1. main module
  • 1.2.2. core module
  • 1.2.3. gui module
  • 1.2.4. ear module
  • 1.2.5. t5compo module
  • 1.2.6. ddltool module
  • 1.2.7. test module