Contribute to the DSpace Development Fund

The newly established DSpace Development Fund supports the development of new features prioritized by DSpace Governance. For a list of planned features see the fund wiki page.

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 30 Next »

 

Installing Eclipse

Obviously, to do this you will need to have Eclipse Installed: http://www.eclipse.org/

This HOW-TO has been written using Eclipse 4.3 (Kepler) And DSpace 4.0. The information here probably works with other versions of Eclipse, but no guarantees are made.

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)

Using 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

Need 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:

    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:

    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
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: 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

 

 



  • No labels