Customize Jetspeed 1.5 using the Maven Jetspeed Plugin

From WittleNet

Jump to: navigation, search

Contents

Overview

I've been watching the Apache Jetspeed project for a few years, ever since I found it when we were thinking of developing or OEMing a portal product where I worked. When I set up wittle.net, I decided to give it a try as the main page for my web site. That was well over a year ago, and done originally with version 1.2.

The experience of using 1.2, and later 1.4, was gratifying in some ways. I liked a lot of the capabilities of Jetspeed, but always struggled with the complexity of setup and customization, as I didn't work with the application or the code frequently enough to become really proficient.

When I started the migration of my customizations to 1.5, I initially was very unhappy with the conversion to using Maven rather than Ant as the primary build and packaging mechanism. Then I found the Jetspeed plugin for maven, and realized that I completely agreed with its goal, which was to allow a user to completely and fairly cleanly separate customizations from the core of Jetspeed, and have a simple way of deploying the customized site when done. The purpose of this page is to document the process I went through, as the Jetspeed plugin is incomplete in several key ways.

Basic Setup and Use of the Jetspeed Plugin for Maven

The basic process of using the Jetspeed plugin is documented here. Note that there are two models for using the Jetspeed plugin; this document covers only the one documents as a binary distribution model. I never got the other model to work.

This plugin is going to assume you know a bit about how Maven works, and so am I. If this assumption is not correct, please read the Getting Started with Maven document.

Now that you know something about Maven, let's talk about what the Jetspeed plugin is going to do. In essence, you will be building a source tree that contains the delta between the portal you want and the default Jetspeed distribution. The Jetspeed Maven plugin is going to handle merging your source with the default distrubtion and creating the war with your custom application. Therefore, your responsibility is to manage in your source directory only files that are deltas from the standard Jetspeed distribution.

The process starts with building a custom Maven project that will contain your portal. That is the purpose of the target jetspeed:genapp. It is going to prompt you with questions about your custom portal, and create a Maven project file and directory structure for it. You run this one time only.

Once you have your custom project file generated, the next step is to begin to start making your changes. The changes will fall into one of three categories:

  • New files for your portal - These get placed in your project's source in a directory structre that matches the contents of the Jetspeed war file. That's all you have to do; the Jetspeed plugin will handle merging these with the files in the default Jetspeed war file into a custom war file for your project.
  • Changes to properties files - To add/modify entries in the various Jetspeed properties files, you create a file in the proper subdirectory of your source directory whose prefix is the full name of the properties file in the Jetspeed distribution and suffix is .merge. For example, to change or add entries to JetspeedResources.properties, you create a the file src/webapp/WEB-INF/conf/JetspeedResources.properties.merge. The path for this is relative to the root directory of your portal. The contents of this file supercede/extend the contents of JetspeedResources.properties from the default distribution.
  • Files to remove from the default distribution - When you consider deploying a portal, there will be files in the default distribution you will probably want to remove, such as demo-portlets.xreg. The shipping version of the Jetspeed plugin doesn't support this, but you can download an update from here that does.

Need to Remove Files from Default Jetspeed Distribution

=

Personal tools