Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Info

February 25, 2011: This is a work in progress that I plan to be developing throughout the first couple of weeks in March of 2011. There are a few versions of instructions currently available on within the DSpace confluence site, some of which are fairly out of date. This page will be covering instructions as relates to creating a development environment on Mac OSX 10.6 (Snow Leopard) while using the latest versions of related software, but will attempt to be platform agnostic.

Table of Contents
outlinetrue
stylenone

Development Environment - Tools: Prerequisite Installations

This initial section will be targeted toward making certain that all prerequisite software tools have been downloaded and installed properly on the system you will be using for your development. Specifically, this is going to cover the following software:

  • Database software - Currently PostgresSQL and Oracle are supported by DSpace.
  • Servlet container software - The most popular servlet container tends to be Apache Tomcat, but others such as Jetty, Geronimo, etc can be used.
  • Build Tools - Maven and Ant are the software project management and comprehension tools used to build and deploy DSpace from source code.
  • IDE (Integrated Development Environment) - Eclipse, our IDE of choice for this endeavor.

Other software that will be noteworthy is the list of plug-ins we will use to extend Eclipse's native functionality. Among these plug-ins are:

  • A servlet container plug-in - Specifically, we will be using the Sysdeo plug-in for Apache Tomcat. This will provide us some ease of control (starting, stopping, debugging) over our servlet container from within the Eclipse IDE.
  • A Maven plug-in - The m2eclipse plug-in will allow us to run Maven commands such as building, cleaning, or packaging from within the Eclipse IDE.
  • An Ant plug-in - This will allow us to run Ant commands from within the Eclipse IDE (this plug-in is built into the versions of Eclipse we will be using).
  • An SVN plug-in - This will provide the ability to access and manipulate svn repositories from within the Eclipse IDE via either Subclipse or Subversive .
  • The Web Tools Platform (WTP) plug-in - WTP provides a large swath of web development abilities from within the Eclipse IDE.
  • The Data Tools Platform (DTP) plug-in - DTP provides a large swath of database development abilities from within the Eclipse IDE.

With this introduction to the necessary tools, the following sections will cover installation of these software packages / plug-ins for your system. As a side note and comment on file system hierarchy philosophy, I'll be using installation locations that (in my interpretation) best reflect the most current Filesystem Hierarchy Standard (specifically, installing most programs under the /usr/local directory).

Database Software

DSpace requires either PostgreSQL 8.4 (or greater) or Oracle 10g (or greater) relational database software. Depending on your setup you may want your databases either local or some remote server. I've found it beneficial to have both available.

PostgreSQL 9.0.3

Eventually, I'll be incorporating specific Mac OS 10.6 related instructions into this wiki page, but for now, I've verified that these instructions work with Mac OS 10.6 (Snow Leopard) and PostgreSQL 9.0.3. Do note the typo in the section containing information on setting up the operating system's "postgres" user. The instructions say "sudu" instead of "sudo" on all but the first line. Also, the configuration options are fairly generic aside from the Mac OSX specific locations and the bonjour flag and could be used as the basis for setting up postgres in other linux / unix environments (save, again, for setting up the operating system's postgres user).

On Mac OS 10.6, you can configure a postgres startup script via the following plist file (this assumes that all your paths are the same as those in the instructions provided above, otherwise changes would be necessary)

The location of the file:

Code Block

/Library/LaunchDaemons/org.postgresql.PostgreSQL.plist

The file contents:

Code Block

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
  <dict>
    <key>Label</key><string>org.postgresql.PostgreSQL</string>
    <key>ServiceDescription</key><string>PostgreSQL Database Server</string>
    <key>Disabled</key><false/>
    <key>Username</key><string>postgres</string>
    <key>Groupname</key><string>postgres</string>
    <key>Program</key><string>/usr/local/pgsql/bin/pg_ctl</string>
    <key>ProgramArguments</key>
    <array>
      <string>-D</string>
      <string>/usr/local/pgsql/data</string>
      <string>-l</string>
      <string>/usr/local/pgsql/data/server.log</string>
      <string>start</string>
    </array>
    <key>KeepAlive</key><false/>
    <key>RunAtLoad</key><true/>
  </dict>
</plist>

Oracle

I've not verified them, but you'll likely meet with success using these instructions for working with Oracle 10g on Mac OS 10.6.

Servlet Container Software

Concerning the servlet containers available, this area will cover Tomcat and act as a placeholder for when/if I'm able to post concerning other popular servlet containers at a later time.

Tomcat 7.0.8

Apache Tomcat's latest stable release is 7.0.8 and can be acquired from the download page at Tomcat's official site. Both binary and source distributions are available. Generally, a binary version is sufficient for setting up a development environment. There are several different packages available for Tomcat:

  • Core - This is the "meat" of the program. The one you'll need to download for getting a base distribution of Tomcat up and running.
  • Documentation - This is the full body of Tomcat documentation available for keeping a local copy. It is the same documentation as that which is available from the website.
  • Deployer - This package contains the Tomcat Client Deployer which is largely a build tool for Tomcat specific tasks. Not necessary for a development environment.
  • Extras - These are other Tomcat related packages, none of which are necessary for setting up the development environment.
  • Embedded - This package is used for embedding Tomcat in your own web application; Not necessary for the development environment.

The only package that is required for our installation is that of the "Core" Tomcat application, though having a local copy of the documentation could be useful, especially if you'll be running on a mobile machine.

To setup Tomcat for use with your development environment (on Mac OS 10.6), download the apache-tomcat-7.0.8.tar.gz file to your filesystem and perform the following commands:

Code Block

$ cd /Users/{user}/Downloads
$ tar -xvf apache-tomcat-7.0.8.tar.gz
$ sudo mv apache-tomcat-7.0.8 /usr/local
$ cd /usr/local
$ sudo ln -s apache-tomcat-7.0.8 tomcat

Other Servlet Container Software

Build Tools

Maven 3.0.2

Ant 1.8.2

Eclipse 3.6

Eclipse plug-ins

Tomcat plug-in

Maven plug-in

Ant plug-in

SVN plug-in

Web Tools Platform plug-in

Database Development plug-in

Remote System Explorer plug-in

Oxygen plug-in

Development Environment - Tools: Configuration

Database Software

PostgreSQL 9.0.3

Oracle

Servlet Container Software

Tomcat 7.0.8

Other Servlet Container Software

Build Tools

Maven 3.0.2

Ant 1.8.2

Eclipse 3.6

Eclipse plug-ins

Tomcat plug-in

Maven plug-in

Ant plug-in

SVN plug-in

Web Tools Platform plug-in

Database Development plug-in

Remote System Explorer plug-in

Oxygen plug-in

DSpace Setup - Installing (Building/Deploying) Your DSpace Project(s)

DSpace Modules - An Introduction to DSpace Modules

Project Architecture - Organizing Your DSpace Project(s)

The One-Big Approach

The One-Project-Per-Module Approach

The Combined Approach

Project Building - Building Your DSpace Projects with Maven

Project Deployment - Deploying Your DSpace Projects with Ant

DSpace Viewing - Viewing Your Projects with Eclipse Tools

Viewing The Application through Tomcat and your browser

Viewing The Database through Database Development Tools

Viewing The Java code through Eclipse Java Editor

Viewing The XML/XSLT code through Oxygen

Extraneous Notes