Building and developing Jetspeed-2 using Maven-2

The Jetspeed-2 build system is, as of version 2.3, fully based upon Apache Maven 3.

This means the Jetspeed project developers as well as custom portal developers and system integrators are provided with a standardized and very pluggable and configurable build environment which follows the standard guidelines of the Maven 2 build framework.

The Jetspeed-2 Portal itself is an application as well as a portal framework based upon a very flexible component architecture which is "assembled" and configured at runtime using Spring Framework. One of the primary features of the Jetspeed-2 Portal is that it can be adapted and configured for very divers and specific requirements. To be able to leverage these features for custom portal projects, configuring Jetspeed-2 to assemble and integrate it for many different target environment(s) requires a very flexible build and configuration toolset as well.

Maven Plugins

The "standard" Maven-2 toolset is capable enough to build and dynamically resolve most components and artifacts needed for a (custom) Jetspeed-2 Portal. But configuring and integrating Jetspeed-2 within your specific project environment usually goes far beyond just building it.

Setting up and interacting with back-end databases, creating and maintaining multiple portal configurations for a specific target deployment environments, and deploying not only "just" a portal war but everything required at runtime, is mostly "out-of-scope" of the standard Maven-2 toolset.

To be able to meet such complex integration requirements (from a Jetspeed-2 project POV) and still leverage the Maven 2 toolset, a few custom Maven "plugins" have been written to provide features like database initialization, portal configuration, and portal deployment which can be configured and used within a standard Maven 2 build environment.

The rationale for the main Jetspeed Maven Plugin, jetspeed:mvn, orchestrating the usage of the other Jetspeed plugins, is described in The Need for a custom Maven lifecycle.

Detailed documentation and configuration for each of these Maven plugins is provided through the Plugins Overview of the Plugins menu and the corresponding plugin pages.

How to build Jetspeed-2 from source, using these plugins, is provided on the From Source page on the Building Jetspeed menu.

Quickstart a new Custom Portal Project using the Jetspeed Archetype

As will become clear from the more detailed descriptions and their usages provided with each plugin, manually setting up and configuring a complete (custom) Jetspeed Portal project is far from trivial and requires quite a few steps to perform.

The basic project layout and configuration however will be in most cases the same.

A quick and easy way of setting up an initial build project configuration is using the Jetspeed Archetype Maven plugin for which detailed description and usage is provided on the Jetspeed Archetype page of the Building Jetspeed menu.

PREREQUISITE: configuration of the Maven Settings pluginGroups

Using a non-standard Maven Plugin (e.g. not provided by the Maven or CodeHaus Plugin projects themselves) from the command line requires a fully qualified specification of the plugin coordinates and goal to execute. This requires in most cases a cumbersome, error prone and verbose amount of typing!

For the Jetspeed-2 Maven Plugins for example, invoking the jetspeed:mvn plugin then requires something like the following:

$mvn org.apache.portals.jetspeed-2:jetspeed:mvn -Dtarget=demo

This can be simplified however by configuring in your user Maven settings how to resolve (additional) plugin groups automatically without having to specify the full plugin groupId coordinate on the command.
See also the main documentation for the Maven Settings.

Adding the Jetspeed-2 Maven Plugins groupId to the pluginGroups in your user Maven settings.xml is therefore recommended and assumed by all example usages given throughout the Jetspeed-2 documentation.

The user Maven settings.xml can be found at: ${user.home}/.m2/settings.xml (create one if it doesn't exist yet).

The Jetspeed-2 groupId org.apache.portals.jetspeed-2 needs to be added as a pluginGroup definition within your user settings.xml as follows:

<?xml version="1.0" encoding="UTF-8"?>
<settings xmlns="http://maven.apache.org/POM/4.0.0">
  <pluginGroups>
    <pluginGroup>org.apache.portals.jetspeed-2</pluginGroup>
    ...
  </pluginGroups>
  ...
</settings>
When the Jetspeed-2 pluginGroup is defined, the example commandline execution as shown above can be simplified to:
$mvn jetspeed:mvn -Dtarget=demo