"Easy" Installer for DSpace

Primary Goals of this work

This work is an initial prototype. It should not be considered stable until formally released as a part of DSpace

Main Goals:

Potential features requiring further investigation:

Initial Usage Details

Where is Code Available At?

The code is available from SVN prototype branch at: http://scm.dspace.org/svn/repo/sandbox/installer-prototype/

This code only includes a customized version of the normal 'dspace' Assembly module from Trunk (1.8.0-SNAPSHOT).

How do I build the installer?

After downloading the code, run the following from [installer-prototype]/dspace/ directory:

mvn package -Pdspace-installer

Currently, to keep the 'installer-prototype' SVN copy very minimal, I have not copied over an entire version of Trunk. The 'installer-prototype' only includes the 'dspace' Assembly directory. So, if you run into Maven build errors, you may first need to build Trunk, in order to ensure your local Maven repository (~/.m2/) has a copy of all 1.8.0-SNAPSHOT dependencies.

How do I run the installer?

After the build completes, you'll see a JAR installer created at [installer-prototype]/dspace/target/dspace-installer-1.8.0-SNAPSHOT.jar

You can execute this Installer by running the following from the [installer-prototype]/dspace/target/ directory:

java -jar dspace-installer-1.8.0-SNAPSHOT.jar

After you run the installer, it will ask a series of questions around where you wish to install a copy of DSpace.

Currently, the Installer only works fully for a clean (fresh) install of DSpace. It is not fully functional in terms of updating or upgrading DSpace (some parts may work, but some may still be buggy).

Initial Implementation Details

How does the Installer work? How is it built/implemented?

Overview of dspace-install-api

The heart of this Installer is the new /dspace/dspace-install-api/ module. This module currently only includes a few new files:

Why embedding Maven into Installer won't work

This section is just a note on implementation details that have unfortunately ended in failure.

Initially, I thought: "If I can embed Ant in the installer to actually create the [dspace] installation directory, why not go one step further and embed Maven, so that the Installer.jar just auto-builds DSpace for you via Maven". The main reason for potentially embedding Maven was to allow for a smaller Installer.jar overall (less duplication of JAR dependencies, for each of the various DSpace WARs), and to allow Maven to do what it does best (namely managing dependencies).

Unfortunately, that is not as simple as it may sound. To properly embed Maven into the Installer.jar, you'd need to do the following:

  1. Embed a complete copy of an offline Maven Repository into the Installer.jar (this would ensure Maven didn't need to go and download all dependencies for you – which obviously slows down the installation process, and wouldn't be much of an improvement over the current DSpace build process)
  2. Embed a copy of Maven into Installer.jar
  3. Ensure that when Installer.jar is run, it kicks off embedded Maven, points it at the embedded offline Maven Repository and then builds & installs DSpace.

Although #2 and #3 above seem to be possible, there seems to be no easy way to do #1 (embedding a copy of an offline maven repo). Unfortunately, Maven does not come with a plugin which can successfully create an entire offline repository, and ensure all dependencies are written there. A few more notes on this:

The Conclusion: At least at this point in time, embedding Maven into an Installer is not really a plausible solution. We'll need to find a better way of avoiding an ever growing Installer.jar file (which is already rather large as some basic dependencies, e.g. dspace-api.jar, are duplicated 7 times in that one Installer.jar, once for each of the six webapps and once in [dspace]/lib).