Reputation: 1989
Whenever we want to create an Eclipse project with an existing source location, we will choose the existing source location(root) as the project location. Eclipse will create all the project specific files in the root directory of that source.
Now, for some reason if we want to re-create the project with different setting, how should we tell Eclipse to not remove the source but all the project related files? It's basically cleaning up all the Eclipse related files. For example, I want to create the project in some other IDE, do I have to go to the project directory and manually identify all the Eclipse related files and remove them?
When we try to delete the project from Eclipse, we are left with two choices, delete everything from the project (when checkbox is checked) or retain everything in the project (this would only remove the project from the project explorer but retains all the project related files in the root source directory).
Every time, manually deleting project related files is cumbersome. It would be good if there is anyway to delete only Eclipse related project files right from Eclipse.
Any thoughts?
Upvotes: 8
Views: 11945
Reputation: 68942
For Windows the problem could be solved with PowerShell:
Get-ChildItem -include .settings -recurse | Remove-Item -force -recurse
Get-ChildItem -include .classpath -recurse | Remove-Item -force -recurse
Upvotes: 1
Reputation:
Thanks for this thread. I would like to do exactly the same. I am following these steps now. 1. Delete project from the Project Explorer (do not delete from disk) 2. Remove .cproject .project .metadata .settings and other eclipse configuration files manually from the disk. This is a way-around and would appreciate if there is a better way to do the same (but everything from within Eclipse). Thanks
Upvotes: 0
Reputation: 7418
On UNIX/Linux you can do it "manually" - Open Terminal and navigate to your project's root directory then execute the following command:
find . \( -name .classpath -o -name .project -o -name .settings \) -exec rm -rf {} \;
And if someone likes aliases:
alias show_eclipse_files='find . \( -name .classpath -o -name .project -o -name .settings \)'
alias delete_eclipse_files='find . \( -name .classpath -o -name .project -o -name .settings \) -exec rm -rf {} \;'
NOTE: You'd better remove the project first from Eclipse so it won't get confused by the missing configuration.
Upvotes: 8
Reputation: 1051
I've faced same problem recently and the most reasonable solution was to use export wizard with additional setup of filter types. So steps to obtain project files without eclipse settings:
Hope that my answer helps to someone
Upvotes: 1