Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3

<?xml version="1.0" encoding="utf-8"?>
<html>
<b><font style="color: red">WARNINGWARNING: This page is still under development</font></b>development

The addon-mechanism for DSpace is a compile time modularity mechanism that allows code level separation between DSpace components. The main goal is to be able to extend DSpace without requiring patches and re-patches that lock developers into a single version of DSpace with no path to upgrade. This addon-mechanism moves DSpace closer to a binary distribution. These changes made by this proposal will make all compiled distributions (war files) non unique, so in the future we could just post binaries for DSpace user's to download and deploy. However the installation and upgrade processes will need to be refactored for this to be fully realized, this moves us a bit closer to that goal.

Panel

Contents

Table of Contents
outlinetrue
stylenone

Preparation

To prepare for the AddonMechanism, the dspace trunk needs to be reorganized to separate the codebase into separate projects. There will be 4 initial separate projects:

...

The process that was completed on the trunk and is outlined here

SimpleAddonMechanism - CodeReorganization  

Maven based Addon Mechanism

...

2.) Checkout the current SVN trunk

Panel

~% svn checkout https://dspace.svn.sourceforge.net/svnroot/dspace/trunkImage Removed

3.) Change Directory to trunk/dspace

...

And you should see the following directory structure:

Code Block

 dspace-1.5-SNAPSHOT.dir
   |-- bin
   |-- config
   |-- docs
   |-- etc
   |-- lib
   |-- webapps
   |     |-- dspace-jspui.war
   |     `-- dspace-oai.war
   |
   |-- CHANGES
   |-- KNOWN_BUGS
   |-- LICENSE
   |-- README
   `-- build.xml

6.) Currently, the configuration process is still Ant driven for the moment. Installation and Upgrade can be done via the original targets.

Panel

~% ant [-Dconfig=-path-to-your-dspace.cfg] [fresh_install]

How does one

...

decide which addons to use?

Addons can be included into the main dspace/pom.xml as modules, and/or configured in the pom via "profiles" which can be activated via command-line or configuration properies. Addons are included into the build process either via being added as a dependency to the "appropriate" dspace webapplication project, or by inclusion as a dependency into the main dspace/pom.xml project descriptor.

...

1.) Create a maven project with a dependency on dspace-api. For example your-addon/pom.xml might contain:

Code Block

<?xml version="1.0" encoding="UTF-8"?>
<project 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/maven-v4_0_0.xsd">
   <modelVersion>4.0.0</modelVersion>
   <groupId>org.your-org</groupId>
   <artifactId>your-addon</artifactId>
   <packaging>jar</packaging>
   <name>Your Addon</name>
   <version>1.0</version>
   <description>Your Addon To DSpace</description>
   <url>http://www.dspace.org</url>

   <dependencies>
      <dependency>
         <groupId>org.dspace</groupId>
         <artifactId>dspace-api</artifactId>
         <version>1.5-SNAPSHOT</version>
      </dependency>
   </dependencies>

</project>

2.) Add dependency on the addon to the webapplication projects you wish to have it included into:

Code Block

<?xml version="1.0" encoding="UTF-8"?>
<project ...>
   <groupId>org.dspace</groupId>
   <artifactId>dspace-jspui</artifactId>
   <packaging>war</packaging>
   ...

   <dependencies>
      ...
      <dependency>
         <groupId>org.dspace</groupId>
         <artifactId>dspace-api</artifactId>
         <version>1.5-SNAPSHOT</version>
      </dependency>
  ~~> <dependency>
         <groupId>org.your-org</groupId>
         <artifactId>your-addon</artifactId>
         <version>1.0</version>
  ~~> </dependency>
   </dependencies>

</project>

...

Code Block
 <?xml version="1.0" encoding="UTF-8"?>
 <project 
    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/maven-v4_0_0.xsd">

    <modelVersion>4.0.0</modelVersion>
    <groupId>org.your-org</groupId>
    <artifactId>your-xmlui-webapp</artifactId>
    <packaging>war</packaging>
    <version>1.0.0</version>
    <description>Your Customized Manakin Webapplication</description>

    <dependencies>
       <dependency>
         <groupId>org.dspace</groupId>
         <artifactId>dspace-xmlui</artifactId>
         <version>1.5-SNAPSHOT</version>
         <type>war</type>
       </dependency>
    </dependencies>

 </project>

...

  • Resolve any and all necessary dependencies from maven repositories (jars and wars) and make them available locally for compilation and packaging.
  • Publish binary versions of our addons into ours http__--ours http://maven.dspace.org DSpace Maven Repository/  and others maven repositories to make them available for the previous process.

...

  • Provides an excellent and highly configurable mechanism for aggregating built addon artifacts under one assembled distribution directory that can then either be packaged into a zip/tar.gz/tar.bz2 archive the current structure of this distribution directory structure can be seen below:
Code Block

 dspace
   |-- pom.xml  <-- Maven project file that defines what modules are to be added to the assembly.
   |-- src
   |    `-- assemble
   |        `-- assembly.xml  <-- descriptor of files/modules to include into distribution and any filtering that is required.
   |      
   `-- target
        `-- dspace-<version>
              |-- bin
              |-- config
              |-- lib
              |-- logs
              |-- logs
              |-- search
              `-- webapps
                    |-- dspace-jspui.war
                    |-- dspace-oai.war
                    `-- ...


  • In the main dspace projects pom file (
    Code Block
    trunk/dspace/pom.xml
    ) one can outline the modules that are to be included into the projects build process.
Code Block
 
   <project>
        <modelVersion>4.0.0</modelVersion>
        <groupId>org.dspace</groupId>
        <artifactId>dspace</artifactId>
        <name>DSpace Installation Project</name>
        <version>1.5-SNAPSHOT</version>
        <packaging>pom</packaging>
        ... 
        <modules>
             <module>../dspace-oai</module>
             <module>../dspace-jspui</module>
             <module>../dspace-xmlui</module>
             <module>../dspace-lni</module>
        </modules>
        ...

...