Section - Sakai Source Websphere Build (2.6)

Websphere is no longer supported. Use at your own risk!

Overview

The build process for the Sakai CLE on Websphere makes use of the existing build procedure and Apache Maven build scripts.

Tailoring the build for Websphere

The additional files under the 'was' directory contain scripts and Websphere specific files that are used to build Sakai for deployment in Websphere. These scripts invoke the Maven build scripts created by the community, but then tailor the build process for a Websphere environment.

The Build Process

The Maven build process for Sakai CLE for Websphere creates an Sakai CLE build in the form of an EAR file that is deployable within Websphere. To achieve this, the build automates and executes the following steps:
• Downloads any dependencies
• Invokes the existing Maven tasks to compile the source code
• Invokes the existing Maven tasks to package the WARs and JARs
• Invokes the existing Maven tasks to deploy the JARs to the directories specified in the settings.xml file
• Packages the EAR using the Maven EAR plugin

Prerequisites

Before starting the build process, a set of perquisites must be met in order to build successfully.

  • Target Environment
    Websphere Application Server (WAS) 6.1.0.17 or higher must be installed in the target environment. In addition, the build is recommended to be executed on the same server as WAS, because it deploys a set of shared libraries and files to a location that Websphere must have read/write access to. During this time, Websphere should be shut down until the build process is complete. If the build is to be performed in a separate environment and then moved to the target environment, an additional step of manually moving the above files must be performed.
  • Sakai Source
    The Sakai source can be obtained from the Sakai Subversion respository (https://source.sakaiproject.org/svn/sakai/trunk).
Maven settings.xml File

A set of properties are required in your M2 settings.xml file:

<appserver.home>=<location of shared library directories>
<maven.tomcat.home>= <same as above>
<sakai.appserver.home> = <same as above>

The above variables should be set to the location where the shared libraries and property files should reside. It can be any directory on the file system that Websphere has read/write access to. If the build is not being performed on the same server as the WAS installation it will be deployed to, then a temporary directory can be used for now. This scenario requires an additional manual step of copying this entire directory structure to the directory that Websphere has read/write access to.

The following are the contents of a sample settings.xml file:

<settings xmlns="http://maven.apache.org/POM/4.0.0"
   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
   xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
                      http://maven.apache.org/xsd/settings-1.0.0.xsd">
  <profiles>
    <profile>
      <id>tomcat5x</id> 
      <activation>
        <activeByDefault>true</activeByDefault> 
      </activation>
      <properties>
        <appserver.home>C:/opt/weeklybuild/WASshared</appserver.home> 
        <maven.tomcat.home>C:/opt/weeklybuild/WASshared</maven.tomcat.home> 
        <sakai.appserver.home>C:/opt/weeklybuild/WASshared</sakai.appserver.home> 
        <surefire.reportFormat>plain</surefire.reportFormat>
        <surefire.useFile>false</surefire.useFile>
      </properties>
    </profile>
  </profiles>
</settings>

 

Performing the Build Process

To start the build process, ensure that all prerequisites are met in the previous section.
The was Maven profile will be used to tell Maven this build is for Websphere. Change to the <source> directory, and type

mvn clean install -Pfull,was sakai:deploy

to build the EAR file and deploy the necessary artifacts.

When the process is complete, a successful build will produce the following results:

  • a directory of shared libraries and files will be deployed to the directories specified in the settings.xml file
  • the deployable EAR file will be in the 'was/ear/target' directory

You must then obtain the proper database driver (mysql-connector-java-5.0.5-bin.jar for MySQL) and place it into the common/lib directory.

If the build was performed on a server separate from the target WAS instance, then move or copy the components, shared, server, and common directories from the directory of shared libraries and files to a location that the target WAS instance has read/write access to.