Search code examples
svnmyeclipse

MyEclipse keeps corrupting my Tortoise SVN repository?


I'm having some strange behavior with MyEclipse Build id: 8.6-20100723 and SVN. I have a Java Struts application with the source and output folders defined as:

pref_center/war/src/main/webapp/WEB-INF/classes --output folder

pref_center/jar/src/main/java ---Java files

When I open the project in Eclipse, make any changes and save the project, Eclipse automatically copies the .svn folders from my java directory to my classes folder. It also copies any .java files that have been changed into the classes folder. The result is that SVN now recognizes the src/main/java directory and the web-INF/classes directory as the same tree. This leads to countless conflicts and eventually the destruction of the SVN repository. My current workaround is to manually delete all the .svn folders from under the classes path (which I have ignored in SVN) to avoid corrupting the repository every time before I do a checkin.

How can I ensure that MyEclipse doesn't copy my .java or .svn files into the classes folder? Is this a bug or something that can be turned off

NOTE:Not sure if it matters but I do not use MyEclipse to build my project. I use maven to build and package my app.


Solution

  • It sounds like MyEclipse IS building your project, to some degree. It seems to be copying what it thinks are resources to the output directory.

    The output directory should not be saved in SVN so you should add it as an ignored resource (right click on the output folder, go to the Team sub-menu and select "Add to svn:ignore"). Why MyEclipse is copying .SVN folders in a team shared project is not clear. If you are not synching with the SVN server from MyEclipse, you would need to add .SVN as an ignored resource. In this case, you might want to consider installing an SVN plug-in, like subclipse or subversive.

    One last thing. As it is copying java source files to the output folder, you may not actually have a source folder set up for your project. Even though you're not building (or don't intentionally build) with MyEclipse, ensure you have a source folder set in the build path properties. You might also want to check that MyEclipse really isn't building automatically (check the main Project->Build Automatically menu item).

    Tony