user84592
user84592

Reputation: 4882

Eclipse: Remove Eclipse generated .class and .project files

I have a Java project with SVN version control system. My IDE is eclipse. Iniitally when I open the project, I edited something. Since this is team project. Someone else commit his own .class and .project file into svn. When I pointed out, he removed .class and .project in some particular sub projects. Anyway, I have .class and .project in all sub projects. Now I want to a clean environment, I want to delete all .class and .project files. Are there some script available in this forum?

Upvotes: 0

Views: 4208

Answers (3)

Piotr Gwiazda
Piotr Gwiazda

Reputation: 12212

Are you using Maven as a build tool? What is your directory structure.

Any bin, out, target etc. directories should be on ignore list in SVN. You can use "add to ignore list" in Tortoise SVN or edit folder properties and set "svn:ignore" property. This you can do recursively. Mind that this will affect other developers too.

If you're not using Maven, deleting .project and .classpath might cause some trouble. There might be some project-specific settings set. Blindly deleting .project files is not a solution. If you use Maven, you can definetely delete .project, .classpath and .settings, add them to ignore list and re-import all proejects with m2e plugin.

Upvotes: 1

Salix alba
Salix alba

Reputation: 7824

If you have a unix like environment then 'find' from a command line could do it. First cd to the project directory then find . ( -name *.class -or -name .project ) -delete

Upvotes: 1

dstronczak
dstronczak

Reputation: 2454

You didn't mention what OS are you using... If it's linux you can do it in commandline like that:

find /the/path/to/your/project -name ".class" -exec rm {} \;

Upvotes: 1

Related Questions