Complex Projects

POM Inheritance

JAM supports projects made up of multiple modules primarily through POM inheritance. Each sub-module's POM can inherit settings from a parent POM by using the extend tag:

<extend>../project.xml</extend> 

This allows you to gather common properties into a parent POM file and keep specialized properties, like module names and unit testing dependencies at the individual module level. You then generate separate props-maven.xml and classpath.xml files for each module with only the required library dependencies, resulting in faster builds and minimal distribution file size.

Project-Wide Properties

If you are maintaining additional property files shared throughout the project, you should define the project.home property in each build file. Typically each sub-module is located in a sub-directory of the main module, so this often entails pointing project.home at the parent directory:

<property name="project.home" location=".."/> 

Then you can create a props-project.xml file in the project directory containing the project-wide settings and import it into each module:

<import file="${project.home}/props-project.xml"/> 

This import statement will already be present if you are using the recommended templates.

Lastly, JAM defines project.name and project.version properties for situations that require you to distinguish between the module and project name. Normally these properties default to the module equivalents and you can ignore the distinction.

Complex Build Configurations

Need to support multiple versions, platforms and clients? There are many Ant, Maven and JAM tricks for achieving this in an elegant manner. Take a look at the flexible-build-config-src-jam-2.1.zip example from the download page for a few ideas.

Post-XDoclet Deployment Descriptor Processing

Need better control over SQL table/column naming or J3EE security descriptors? Perhaps post-processing your deployment descriptors using XSLT would solve the problem. Look at the post-process-ejb-dd-src-1.0.zip file on the download page for an example how to achieve this from Ant.