Versions Compared

Key

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

...

  • The initial Installer is packaged using One-Jar. One-Jar essentially provides us with an easy way to create an executable JAR file.
  • When a user runs the JAR file, the One-JAR 'Boot' class is automatically called
  • Wiki Markup
    The One-JAR 'Boot' class automatically calls whatever is located at {{/main/main.jar}} within the installer.jar file.  In our case, {{/main/main.jar}} calls the new dspace-install-api.jar file (see {{\[installer-prototype\]/dspace/src/assemble/installer-assembly.xml}} for details)
  • The dspace-install-api.jar is what actually performs the installation
    • This JAR actually embeds Apache Ant within it, and also contains a custom Ant script (installer-build.xml) which creates the DSpace installation directory similar to how it is created in past versions of DSpace. More notes on this below.
  • Wiki Markup
    NOTE: The 'dspace-installer.jar' actually includes a full copy of all third party dependencies (JARs) as well as a copy of the DSpace install directory.  See the {{\[installer-prototype\]/dspace/src/assemble/installer-assembly.xml}} for details.

...

  • Wiki Markup
    {{org.dspace.install.Installer}} - This is the main executable Installer class.  Currently, it essentially just uses the Apache Ant API to call a custom Installer 'installer-build.xml' file (which is based off the default DSpace {{\[installer-prototype\]/dspace/src/main/config/build.xml}} file). NOTE: Even though this installer uses the Ant API, Ant is *not* required to be installed on the local system.  The Ant API is included within the Installer itself.
  • /src/main/resources/installer-build.xml - This is the Ant Build file which actually tells Ant what it needs to do to actually perform the Install process.

Why embedding Maven into Installer won't work

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

Wiki Markup
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, 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: