Thursday, February 14, 2008

How to exclude .svn folders from project -Eclipse

Ref:
http://pyre.third-bit.com/blog/archives/101.html
http://lists.ofbiz.org/pipermail/dev/2006-January/009586.html
http://www.malcolmhall.com/?p=98

I’ve just began using Eclipse instead of IntelliJ and one thing had me stumped for an hour. My src folder was under SVN but my bin folder wasn’t, however when I compile, the tortoise plugin for windows explorer suddenly showed the bin folder as under SVN with an exclamation over the folder icon. What was going on? It appears that when Eclipse builds, it copies any files and folders form the src folder to the bin folder including the .svn hidden folders. I had just about given up with Eclipse then I started hunting for a way to manually exclude the .svn folders from the build. A few attempts at making my own exclude pattern which only worked in a few cases I finally found this neat solution on the web:

Modify the project’s java build path to exclude the pattern **/.svn/

Here’s complete directions:
Project / Properties / Java Build Path / Source / unfold your project / Excluded / Edit / Exclusion patterns / Add / “**/.svn/*”