So while working on a project at work, I was experimenting with committing a symbolic link (symlink) for a folder that was contained in my project into Subversion.

While the symlink gets marked with the svn:special (More Info) property when committing and works properly for all intents and purposes, the problem I encountered was working with that inside of Eclipse using the Subclipse plugin.

The problem is that while it gets saved as a special file in Subversion, it gets translated back into a legitimate symlink while checking out or updating by SVN clients. This means it’ll on occasion try to check out the contents of the actual folder the symlink is pointed to.

Eclipse and by extension Subclipse will see it as an actual folder. As a result during Team Synchronization or any other SVN operations, it will attempt to commit content that is in the folder I have the link pointed to. As you can imagine this can create a ton of headaches. Not only is the behavior unpredictable, it would attempt to include even the hidden .svn files of the actual folder.

To get around this problem the simple solution is to created a special linked folder resource for the symlink so that Eclipse won’t treat it as an actual folder. As a result Subclipse will also stop attempting to synchronize it.

Since my symlink exists already, creating the linked folder resource via the GUI interface is not possible.

(Normally you could just go to Create New Folder > Advanced > Link to alternate location.)

In my case I had to edit the .project file (it may be filtered/hidden).

By adding in the following XML, you can create the linked folder resource to designate your symlink as such within Eclipse. Of particular note is the requirement that the location you are linking to is an absolute path.

Since we’re talking about Subversion here I’ll go ahead and assume you’re working in a team and not everyone will have their project located in the same directory structure. To address this you can use the built in variable PROJECT_LOC to make your folder relative to the location of the project, ensuring everyone has the proper absolute link.

Now all you have to do is commit the .project file and other people can check out your project complete with the symlinked folder without running into random issues with committing code.