Repost: Make Eclipse ignore .svn directories
PDFEclipse has the annoying little problem where Eclipse will copy .svn folders to the target/classes output folder and then complain about duplicate resources. After wading through some vague solutions, here’s a clear and simple post I found to solve this annoyance.
Make Eclipse ignore .svn directories
Window -> Preferences…, Java -> Compiler -> Building. Under “Output folder” add “, .svn/” to “Filtered Resources” (so that you get “*.launch, .svn/”).
It still works like a charm. Thanks Brian.
Tags: eclipse
Gilles Guillemin
Thanks man, I wish I knew that one looooong before. It would have spared me many many headaches. At least looks like they’re now over!
Marcel Panse
Great! Is it also possible to exclude all svn dirs from the Search results in Eclipse?
Benny Bottema Post author
Haven’t verified myself, but if you would install the Subclipse plugin, it should exclude the folders for you. Make sure your project is in ‘Shared’ mode.
Marcel Panse
Well, the whole point was to _not_ install a subversion plugin into eclipse 🙂
Rob Wall
We just did this nifty thing where we put all our unit tests out into a parallel folder heirachy, and tell eclipse (and ant) that we have two source roots. The only snag was hitting this problem & your fixed worked brilliantly. Thanks.
Cristian Rusu
Hi
I added that line in compiler building but I still get the folders copied, no files, just folders under .svn, any thoughts?
Angel Ivanov
But when eclipse project is exported as *.zip, *.jar, *.war, *.ear – .svn directories are packaged within! Is there any way to solve this problem?
Emir Buğra KÖKSALAN
you can use maven. the development cycle is: coding in eclipse, compiling and packing in maven. this method is more flexible.
K R
did u find any solution for this Angel Ivanov ????Am also facing the problem 🙁
Tilman
Same here. Any solution?
Danbe
Great Help, thank you very much!!!
Kata
I found the following solution to the problem with empty .svn-directories still being created (as Cristian Rusu described):
Project > Properties > Java Build Path
For each source folder, edit Excluded to include the pattern **/.svn/
Solution found at http://www.damonkohler.com/2009/07/make-eclipse-ignore-svn-directories.html .
Benny Bottema Post author
@Angel Ivanov, @K R and @Tilman:
I think Kata’s suggested solution works, but also consider the following:
I say only use Eclipse generate artifacts for testing purposed or quick mockups. The best building and distribution strategy for me is to just use Ant (or Maven if that suits you). Then configure those to not include .svn folders and then don’t worry about Eclipse including them when it does (since it’s only temporary).
Sharron Clemons
Haven’t verified myself, but if you would install the Subclipse plugin, it should exclude the folders for you. Make sure your project is in ‘Shared’ mode.