Why is Eclipse trying to copy my .svn folders from src to bin, and how can I make it stop?
Asked Answered
S

6

35

I have checked out a bunch of java code using subversion 1.6 and then I imported those projects into eclipse. Subclipse 1.6 picked up the fact that the plugins are under version control, except for a few folders.

I now get a bunch of errors like:

The resource is a duplicate of src/.svn/all-wcprops and was not copied to the output folder

If I delete the project (from eclipse not on disk) and reimport it, that fixes the problem about half the time. But since I have dozens of projects that are having this problem, it means reimporting them 10-20 times before I get them all working. This is very painful, and I am tired of doing it every time someone adds a new plugin to svn or when I need to recreate a workspace for some reason.

Is there an easier way to fix this than delete and reimport? Or is there a way to prevent this problem in the first place?

Stoplight answered 10/11, 2009 at 17:41 Comment(1)
Is this helpful? #225875Heterolysis
G
20

This is happening because you checked out a project using an SVN client other than Eclipse and then imported the project in Eclipse and you haven't notified Eclipse that this is an SVN project (that is, Eclipse doesn't know it has to ignore the SVN meta information).

In order to fix this properly, after you have imported the project in Eclipse, have Eclipse be 'aware' of the SVN nature of the project. Do so by

  1. Select the project and go to the Team > Share section.
  2. A dialog will appear asking weather this is a CVS or SVN project. Select the later.
  3. It will prompt for the credentials, enter them.
  4. When you're done, do a clean build. The problem goes away.
Garamond answered 6/1, 2010 at 21:20 Comment(1)
The clean build was the missing piece for me. Thankyou!Hark
R
40

Add the .svn folder to the Excluded list for your Source Folder.

  • Project->Properties
  • Java Build Path
  • Source tab
  • Select 'Excluded'
  • click
  • Click next to the Exclusion patterns section on the bottom
  • Add the .svn folder and any others that do not need to be copied to the output directory
Rotherham answered 10/11, 2009 at 18:45 Comment(1)
I already had entries for .svn in the exclude, but for some reason on exactly two files it did not work.Tva
P
28

Follow the procedure described by Kelly but define the exclusion pattern as **/.svn/*. This will recursively exclude all .svn directories from the various source folders.

Poesy answered 10/11, 2009 at 20:21 Comment(1)
Finally! That did it for me. The other answers did not work for me.Tva
G
20

This is happening because you checked out a project using an SVN client other than Eclipse and then imported the project in Eclipse and you haven't notified Eclipse that this is an SVN project (that is, Eclipse doesn't know it has to ignore the SVN meta information).

In order to fix this properly, after you have imported the project in Eclipse, have Eclipse be 'aware' of the SVN nature of the project. Do so by

  1. Select the project and go to the Team > Share section.
  2. A dialog will appear asking weather this is a CVS or SVN project. Select the later.
  3. It will prompt for the credentials, enter them.
  4. When you're done, do a clean build. The problem goes away.
Garamond answered 6/1, 2010 at 21:20 Comment(1)
The clean build was the missing piece for me. Thankyou!Hark
E
9

Easier way to do this is:

  • Project > Properties
  • Resource > Resource Filters > Add...
  • Filter type > Exclude all
  • Applies to > Folders
  • Check All children (recursive)
  • File and Folder Attributes > Type ".svn"
  • Hit OK and OK again
  • Clean/build
Edmonton answered 14/9, 2011 at 16:27 Comment(1)
Cheers! I couldn't seem to get the Java Build Path approach to work. Never quite got the hang of the */ syntax stuff. This was simpler.Procarp
N
1

------------ Simple way of filtering the output folder-------------

Window->Preferences->Java->Compiler->Building
Make sure "Filtered Resources" includes ".svn/"

Numbskull answered 3/7, 2017 at 6:44 Comment(0)
A
0

The "accepted best answer" described the cause to me, but as my project was already shared, I 1. closed the project, 2. opend it again and 3. cleaned it. The .svn folder is gone and does not come back.

Adham answered 14/9, 2014 at 11:13 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.