Using Subversion with Eclipse for DS-5

This tutorial explains how to integrate the open source subversion (SVN) source control system into Eclipse for DS-5.

Using Subversion with Eclipse for DS-5

A source control system (SCS) allows you to version your source files and share them with other developers. There are many source control systems available, both commercial and open source. This tutorial explains how to integrate the open source subversion (svn) source control system into Eclipse for DS-5. It assumes you are already familiar with the basic concepts of using svn and already have a svn server running in which to host your code.

Installation

Eclipse for DS-5 does not come with svn integration as standard, but this can be easily added afterwards. There are two popular svn tools for Eclipse available, Subclipse and Subversive. Both tools provide similar features and are actively maintained, so it is up to you to choose between them. This tutorial uses Subclipse as the example.

First it is necessary to choose the correct version of the Subclipse plug-ins. The two factors to consider are the Eclipse version and the svn version.

You can find your Eclipse version by selecting About Eclipse Platform from the Help menu in Eclipse.

about Eclipse dialog for DS-5

The svn version is important if you want to share your source checkout both with Eclipse for DS-5 and with other external tools. A common example is if wanting to use the svn tools from a console or shell. If you use mismatched svn tools in the same checkout then the newest tool might upgrade the metadata in your checkout so that it becomes inaccessible to the older tools. For this reason, check the svn version in any other tools that you are using and ensure that they are all consistent. Use the Subclipse download page to locate the appropriate Eclipse update site URL for the version of Eclipse and svn that you are using.

To install the Subclipse plugins

  1. Select Install New Software from the Help menu in Eclipse.
  2. Click the Add button, and enter the update site URL from the Subclipse website into the Location field, and provide a suitable Name. Click OK.

    Add SVN repo options

  3. The Install dialog should refresh and list the available Subclipse plug-ins. It is recommended to select all of the available plug-ins, Subclipse and SVNKit. Refer to the Subclipse website for further information on what exactly all of these do.

    Eclipse install new software dialog in DS-5

  4. Click Next and review the plug-ins to be installed.
  5. Click Next and review and accept the plug-in license agreements.
  6. Click Finish. Installation of the plug-ins commences and might take a few minutes to complete.
  7. You might receive a warning during installation that the plug-ins are unsigned. Click OK to dismiss this warning.
  8. At the end of installation you are prompted to restart Eclipse. It is recommended that you select Yes to restart Eclipse. Restarting ensures that the plug-ins are correctly initialized.

Configuration

Once the Subclipse plug-ins are installed into Eclipse for DS-5 you might need to configure them. To do this:

  1. Select Preferences from the Window menu in Eclipse.
  2. Navigate to the Team > SVN entry in the left-hand panel and select it.
  3. The main preference to review is called SVN interface. This controls whether Subclipse uses built-in svn support (SVNKit) or uses svn tools that you have installed separately on your computer (JavaHL). If you already have svn tools installed on your computer and accessible from the PATH environment variable then it is recommended to choose the JavaHL option as this potentially provides better compatibility between svn and Eclipse. If you do not have separate svn tools then choose SVNKit.

    SVN preferences in DS-5

  4. The other Subclipse preferences primarily reflect your personal choices and you are encouraged to review and change them to suit your needs.
  5. With all changes made, click OK to close the Preferences dialog.

Using Subclipse

With Subclipse installed and configured you can now use it to manage your source projects. The following provides a summary of the features available:

  • Checkout existing projects from svn: If you have an existing project in svn you can check it out by selecting Import from the File menu, and then choosing the SVN > Checkout projects from SVN option.
  • Manage svn projects: Assuming you have a project in Eclipse that is stored in svn, then you can update, review changes, revert changes and check-in from within the IDE. To do this, navigate to your project in the Project Explorer view and right-click on the project, a folder or a file, as appropriate, and use the Team menu to perform any source control operations.
  • Browse svn repositories: A separate Eclipse perspective is provided to allow browsing an entire svn repository. To do this, select Open Perspective > Other… from the Window menu, choose the SVN Repository Exploring perspective and click OK. In the SVN Repositories view you can register svn repositories and browse their contents.

You can find lots more help on the Subclipse website or in the documentation that is installed into Eclipse by the Subclipse plug-ins.