May 22, 2008

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:


Then in the property content box add the following:

[yourLibraryName] -r98 [url to repo]

e.g. jquery-validation -r98

In the above example a directory called “jquery-validation” will be created with the contents of the repository located at “".

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

© Michael Sharman 2017