Setting Up Svn:externals With Subclipse

Setting up “externals” with subversion can assist you when you want to load external libraries into an existing project.

You may have a JavaScript validation framework which you re-use amongst many projects. Of course you don’t want to copy and paste the code into every project, what would happen then if you wanted to upgrade the codebase?

Using subclipse (in the Eclipse IDE) you can link a separate svn repository in the middle of your project by adding an svn:externals property. Right click the parent directory you want to import the external repository into and choose “Team -> Set Property”

Once you load the properties dialog window you need to add the following into the property field:

svn:externals

Then in the property content box add the following:

[yourLibraryName] -r98 [url to repo]

1
e.g. jquery-validation -r98 https://myhome.com/svn/repos/jquery-validation/trunk

In the above example a directory called “jquery-validation” will be created with the contents of the repository located at “https://myhome.com/svn/repos/jquery-validation/trunk”.

The “-r98” is the revision number of the external library you want to add. This is important because it means you can link to a snapshot of the library and not simply the trunk (which would mean you couldn’t control the updates to the library).

Once that is done simply update your project and it will import your external codebase into your project.

Thanks to Mark for showing me syntax for this one :)

SVN

Comments