Skip to main content
Enterprise Agile Planning Image

This post is from the CollabNet VersionOne blog and has not been updated since the original publish date.

Last Updated Mar 06, 2011 — Enterprise Agile Planning expert

Usage of SVN Externals

Enterprise Agile Planning

How do people typically create dependencies using Subversion?

Here are some guidelines:

  • Avoid copying common code; for example, you don’t want JBoss in every java project
  • Be able to easily reference a “pegged” revision of the code.  For example, your project may specifically require version 3_2_6 of JBoss
  • Be able to track the “bleeding edge” of some dependencies, for example, you may want to always stay current on the spring framework you use

A common strategy for dealing with this situation in Subversion is something called the “externals”.  The externals in Subversion could be  a link to another subversion repository.

Since all Subversion repositories are identified by URL, it is easy to construct a reference to an external source.

Externals make use of another feature of Subversion, the property.

Properties are simply name/value pairs.  An example might make this clearer.

Suppose your development project has the following structure:

/branches

/tags

/trunk/j2eeapplication

/trunk/thirdparty

And our development project component uses JBoss.  We are required to use the latest version of gddwebapps but gddwebapps has specific dependencies on JBoss 3_2_6

And further suppose our development group has setup a repository containing versions of gddwebapps component at this URL:

https://myproject.collab.net/svn/repos/gddwebapps

And the JBoss 3_2_6 is located in another SVN repository

https://myproject.collab.net/svn/repos/jbossserver

Using the setup below, one would set the built-in subversion property, svn:externals on the /trunk/thirdparty directory.

https://myproject.collab.net/svn/repos/gddwebapps/trunk/thirdparty

This property would have this value:

JBoss3_2_6 https://myproject.collab.net/svn/repos/jbossserver

So how would you set this up?

Here is a “How To” example:

Step 1:

cd to …gddwebapptrunkthirdparty directory

Step 2:

svn propset  svn:externals “JBoss 3_2_6

https://myproject.collab.net/svn/repos/jbossserver/JBoss_3_2_6”  .

Step 3:  svn commit

Step 4:  svn update

(This will fetch external item into ‘JBoss 3_2_6’)

JBoss_3_2_6 now appears  in the ../gddwebapp/trunk folder (workspace) as illustrated in Figure A.

Figure A




Upon branching i.e. creating a nick_devel branch, external JBoss_3_2_6  appears in the nick_devel workspace as illustrated below in Figures B and C.

Figure B


Figure C


More from the Blog

View more
Apr 08, 2021

Making IT services more agile

Enterprise Agile Planning
The agile revolution completely transformed how we create digital prod ...
Read More
Feb 14, 2021

Reflecting on the 20th anniversary of the Agile Manifesto

Enterprise Agile Planning
Over the past 20 years, it’s been amazing to watch an idea from ...
Read More
Feb 08, 2021

How does agile apply to an entire organization?

Enterprise Agile Planning
Before we dive into the main subject of this blog post, it is importan ...
Read More
Feb 03, 2021

It took a pandemic to realize why digital transformation actually matters

Enterprise Agile Planning
Before anyone had ever heard of COVID-19, businesses across the globe ...
Read More
Contact Us