Repost: Make Eclipse ignore .svn directories

PDF

Eclipse 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:
  • 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!

    Reply

  • Marcel Panse

    Great! Is it also possible to exclude all svn dirs from the Search results in Eclipse?

    Reply

  • 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.

    Reply

  • 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.

    Reply

  • 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?

    Reply

  • 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?

    Reply

  • K R

    did u find any solution for this Angel Ivanov ????Am also facing the problem 🙁

    Reply

  • Danbe

    Great Help, thank you very much!!!

    Reply

  • 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 .

    Reply

  • 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).

    Reply

  • 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.

    Reply

Leave a Reply to Danbe Cancel Reply