21

Eclipse project, I have Subversion set to ignore the bin directory, and also within Eclipse I added bin to the list of ignored resources.

However, every now and then Eclipse puts a .svn directory into bin anyway. This doesn't interfere with Subversion checkins (as the Subversion commandline client obeys the standing directive to ignore the entire bin directory) but it does mess up the display in TortoiseSVN.

Is there a known fix or workaround for this?

(Eclipse 3.5, Windows Vista.)

rwallace
  • 31,405
  • 40
  • 123
  • 242

7 Answers7

22

It looks like what is actually happening is that eclipse is copying the .svn directory from your source directories as part of its build -- it thinks it is a "resource" to be copied to your output bin directory. To get it to stop doing that, you can add .svn/ as a filtered resource. In the Properties dialog for your workspace or for your project, go to: Java Compiler | Building and add ".svn" to the list of 'Filtered resources:' under 'Output folder'.

I haven't tried it but I wouldn't be surprised if installing one of the subversion plugins for eclipse also filters the .svn directories for you so anyone with a subversion plugin installed wouldn't notice this problem.

Georg Schölly
  • 124,188
  • 49
  • 220
  • 267
Brian Alexander
  • 236
  • 1
  • 2
  • 3
    This works, provided you spell it .svn/ with the trailing /. Thanks! – rwallace Sep 10 '09 at 02:47
  • 1
    Can someone confirm what would happen if a subversion eclipse plugin is installed? Would I have to undo the .svn/ fix? Would the plugin filter the .svn folders as Brian suggests? This applies to subclipse and subversive, since I haven't installed either yet, and I'm not sure which one I should get. Thank you. – Alex Apr 19 '11 at 16:10
  • I have sub eclipse for 3.7.2 and I currently face the same behaviour. I switched off the autobuild feature in eclipse to test maven build and compile and after i switched it on I face .svn directories in the bin folder, too. So I think generally it is filtered out but once the autobuild is switched off and on again it seams to not filter those directories anymore. I had to reconfigure the filter as the solution suggests. – Martin Kersten Nov 11 '13 at 11:55
  • Great, thank you - this worked for me. However, one needs to remember to comma-separate the list of filtered resources, thus if you already have some entries, and simply add ".svn" after a space, it will not work. – Wojtek Jarosz Dec 11 '14 at 20:47
5

After a long search, starting from this and similar posts I finally fixed this with the help of http://www.damonkohler.com/2009/07/make-eclipse-ignore-svn-directories.html

The source folder pattern that worked for me is slightly different then the one given on the blog however, namely "****/.svn/"** instead of "****/.svn***"

Without the first step, the second step (which has also been mentioned before as a solution) has no effect according to my experience. Thanks Daemon!

The recipe:

1. Project > Properties > Java Build Path For each source folder, edit Excluded to include the pattern "****/.svn/"**

2. Project > Properties > Java Compiler > Building > Enable project specific settings Check the box.

Project > Properties > Java Compiler > Building > Output folder > Filtered resources Add ".svn/" so that it reads "*.launch, .svn/"

Gid
  • 51
  • 1
  • 1
  • I'm using Eclipse 4.2.0 Juno and what solely helped was the item 1 from your recipe. Also it may be hard to notice at first but there are double asterisks `**` in `**/.svn/` – Mike Sep 12 '12 at 20:42
  • Just like Mike said, step 1 was all I needed, thanks! – Federico Cristina Nov 12 '13 at 17:12
0

Which SVN plugin are you using? Subclipse or Subversive? It is not an Eclipse problem per se, but rather it sounds like a problem with the particular eclipse plugin you are using for SVN. It could be that there needs to be a problem report written for that plugin.

James E. Ervin
  • 161
  • 1
  • 3
  • None! I'm using the Subversion commandline client and TortoiseSVN. I never installed any Subversion plug-in for Eclipse, which to my mind makes it all the more surprising that Eclipse is doing this. – rwallace Aug 26 '09 at 10:12
0

Hmm that is very strange indeed. Goto your plugins directory or look at Help > About Eclipse and check to see which plugins you have installed. Look for something with svn, subversion, or polarion, if they are there then you probably have an issue with that plugin interfering.

If not, I think you could have something going on with your installation of subversion(Tortoise SVN). It would then be very very unlikely Eclipse is causing this issue.

Btw, I have seen miscellaneous issues with not only Eclipse SVN plugin support (I wish the svn plugins were half as good as Eclipse CVS support), but with the command line subversion tools sometimes. It could be an issue with the version of Subversion you are using or something you are doing/not doing with svn. Check to make sure that the property svn:ignore is set correctly. You can do that with svn pl, don't be surprised if the property is not set correctly to ignore bin. Remember the delimiter in that case is not comma, but a new line.

Good Luck

James E. Ervin
  • 161
  • 1
  • 3
  • I checked both via the About box and via Windows command prompt, and no sign of a plug-in with any of those names. And both the Subversion commandline client and TortoiseSVN confirm that the ignore property is set correctly, and my Subversion setup has worked correctly in all other cases and I haven't done anything unusual with it. I'll keep an eye on it and see if I can pick up any clues to the circumstances under which bin/.svn gets created. – rwallace Aug 28 '09 at 11:19
0

Non of the above worked for me, but trashing and re-creating the eclipse project did:

  • Delete your project from eclipse (not from disk).
  • "File"->"New.."->"Project"->"Android Project"
  • in "New Adroid Project"-Dialog selected "create project from existing source" (find your project on HDD)->"Finish"

(as instructed from link)

Community
  • 1
  • 1
0

I am using Eclipse Photon with Totoise SVN 1.10.0 (on Windows 10-64 bit), I have faced the above problem, the solution that worked for me was to include an exclusion filter to src -> build path -> Configure Inclusion/Exclusion Filter (as mentioned by Gid partly above, the pattern mentioned did not work for me), however, for me it was enough to include the exclusion filter, the pattern I used is ".svn/", refer image below.

enter image description here

Ironluca
  • 3,402
  • 4
  • 25
  • 32
0

In my experience, installing Subversive prevents Eclipse from copying the .svn folders to the build directory.

David
  • 1,157
  • 2
  • 12
  • 19