Versions Compared

Key

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

Table of Contents
outlinetrue
stylenone

Introduction / Goals / Objectives

...

The SCM you use is certainly up to you (and your organization). However, Duraspace provides source code repositories for DSpace via both Subversion^1^* and Git^2^*.

CVS

With the development of DSpace being so closely intertwined with Maven, and my relative inexperience with CVS for Maven projects, I'm recommending against this option and can provide no real assistance. Please feel free to expand this section.

Subversion

This is a perfectly sound option though it does have some constraints on the versions of software that you may end up using.

Git.

Git

The DSpace Git repository is very new (Jan 2012) so I can't give a lot of detail at the moment. Also, I've not yet had the opportunity to setup Git on my development machines. I'll be providing more information on this option in the coming months (Feb-April 2012).located here: https://github.com/DSpace/DSpace.git

Build Tools

Utilities necessary for deploying an instance of DSpace

...

The current version of Eclipse (as of 20122014-02-0113) is 4.3.7, codenamed "IndigoKepler". This is the version that will be the subject of this wiki page. Keep in mind that there are several very popular Eclipse "packages". The significance of an Eclipse package is which tools or plugins are bundled with that particular download. The three most popular (in ascending order of size / number of included tools/plugins) are:

  1. Eclipse Classic - This version is only the base Eclipse software (3rd most popular).
    1. This version includes no additional tools or plugins except for Git Support.
  2. Eclipse for Java Developers - This version includes some basic plugins, here are the highlights:
    1. CVSGit
    2. Egit
    3. m2e
    4. Mylyn
  3. Eclipse for Java EE Developers - This version includes more, but not all that the regular Java version provides.
    1. CVS
    2. Mylyn
    3. DataTools
    4. JDT (Java Development Tools)
    5. JST (J2EE Standard Tools)
    6. WST (Web Standard Tools - this encompasses JDT, JST, and some others)
    7. RSE (Remote System Explorer - otherwise known as Target Management)

I highly recommend choosing Eclipse for Java EE Developers as it is very likely that you make good use of all the included tools save perhaps for Mylyn (depending on your organization / institution's development environment). Also, this is the package that I'll be using for this tutorial (other plugins will be added via the Eclipse update tool as well as , the Eclipse Marketplace or the Eclipse "plugins" folder). Feel free to make notes within this page for different versions of installation instructions.

...

Subversive

m2e

Maven to Eclipse There have been significant developments recently within the integration between Eclipse and Maven, not all of this is good. However, if starting from scratch, building a new IDE from the ground up, you don't have to worry about breaking existing projects. As long as this is the case, you shouldn't have to worry about the state of Eclipse-Maven integrationis included in some of the packages. However it is not working with the current Release of DSpace 4.0.

m2e Extensions

These are extensions for the m2e plugin and are available through the m2e marketplace (accessible from within Eclipse).

...

Configuring Your Environment

Installing Git

Eclipse Kepler comes with Git support and you could clone the repository with Eclipse . However this HOW-TO will not explain the cloning of the repository with Eclipse because it doesn't work as expected.
So you have to install Git on your operating system from:

  • Git Homepage (includes info on downloading & installing on major platforms)
Note
titleUsing a Local Repository instead?

If your institution plans to instead use a local repository (mercurial, git, svn...) for your local development, you can do so (you will just need to download the DSpace Source Code and import into your local repository).

Installing Maven

For most Linux distributions, you should be able to just install the Maven client available in your distribution's repositories.
For all other operating systems, you can install the latest version from the Apache Maven site.

Checkout DSpace from GitHub

Note
titleNeed a tutorial on Git/GitHub?

If you need help/tips/resources on DSpace development with Git/GitHub, or just tutorials on Git in general, you may want to check out our DSpace Development with Git page.

  • IMPORTANT NOTE: If you plan to do a larger amount of DSpace development or local changes, you may wish to first "fork" the DSpace GitHub Repository (https://github.com/DSpace/DSpace) to your own GitHub account. This will create your own copy of the DSpace source code under your GitHub account (e.g. https://github.com/\[your-username\]/DSpace). You can then checkout your own forked repository to work from and commit local changes to (push changes to). For more information, see the GitHub help page on "Forking a Repo".

 

To work on DSpace you have to make a clone of the remote repository on your local machine. To do this:

  • move into the directory where you want to have the DSpace source folder
  • clone the repository with:

    Code Block
    git clone https://github.com/DSpace/DSpace.git

    IMPORTANT NOTE:With the command below you will work on the master branch of DSpace to change this you can either change the branch you are working on after the cloning or you can clone the remote repository with the additional option -b <branch-name>
    For example:

    Code Block
    git clone https://github.com/DSpace/DSpace.git -b dspace-4_x

    (for existing branches see https://github.com/DSpace/DSpace.git)

Build DSpace and create Eclipse Configuration Files

To execute the following commands you need to have the DSpace sources downloaded or cloned on your hard drive and Maven installed.

YOUR_DSPACE_SOURCE_FOLDER = The complete path to the dspace sources. Something like /home/myusername/workspace/DSpace
Code Block
cd DSpace # enter the folder with the dspace sources
mvn package # Build DSpace with maven
mvn -Declipse.workspace=YOUR_DSPACE_SOURCE_FOLDER eclipse:configure-workspace # Create DSpace workspace with the maven eclipse plugin
mvn eclipse:eclipse # Create Eclipse config files with the maven eclipse plugin

Import Projects into Eclipse

If you have done the steps described before you can import the maven modules into Eclipse with this steps:

  • Open Eclipse
  • Choose: File -> Import -> General -> Existing Projects Into Workspace
  • Click Next
  • Click Browse
  • You don't have to select anything just click ok

That's it.you should see multiple Projects now. To make a Maven overlay just use the projects without dspace- in their names (like project xmlui).

If you want to have Git support in Eclipse you might have to:

  • Select all projects right click and select Team -> Share Project...
  • Choose Git and click next
  • Just press Finsh and you are done

Debugging with Tomcat

For debugging with Eclipse and Tomcat you need to have Tomcat installed, the webapps deployed (see installation HOW-TO) and activate remote debugging (see: http://wiki.apache.org/tomcat/FAQ/Developing#Q2)

  1. Open tomcat settings in (on Ubuntu) /etc/default/tomcat7
  2. Uncomment line: 

    1. JAVA_OPTS="${JAVA_OPTS} -Xdebug -Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=n
  3. Restart tomcat like: sudo service tomcat7 restart
  4. In Eclipse choose a module/project like dspace-api click on Debug Configurations... -> Remote Java Applications
  5. Enter your tomcat address (like localhost) and the Port 8000.
  6. At tab source add the other modules (like dspace-xmlui)

To actually debug the code you have to connect to tomcat by clicking on the new created Debug Configuration (in our case its called dspace-api) and visit the DSpace site with your browser.

Build and Install DSpace

Initially and after every change to the code you have to build the project with maven and deploy the changes to Tomcat (install/update DSpace). For further information see Installing DSpace and Rebuild DSpace

A Quick Feature Run-Through

...