2
votes

Is there a way to delete an Eclipse project while preserving all the resources? (i.e. source code, etc.).

I guess I could delete the following files from the project directory manually:

.cproject
.project

But I am concerned that my Eclipse .metadata information that lives in my workspace may still look for those files and get confused if I delete the project files manually.

1
What do you exactly want to achieve? "Remove the project from Eclipse" means "remove from project explorer"? - shkschneider
@shkschneider Yes, I would like remove all the Eclipse-related information about the project. Ultimately, I would like to re-create the project from scratch. Sometimes my index for my project stops working, and I noticed that rebuilding/refreshing the index or cleaning and rebuilding the binaries doesn't fix it. In those cases, I found that re-creating the project from scratch helps, but if I click on "delete project" it also deletes my source code (in the past I fixed this by restoring my source code from my git repository, but it would be easier if Eclipse does not delete the src code) - Josh
Eclipse proposes to remove sources when you remove a project. Uncheck this. Also ls -lA /your/project/path should tell you what files to remove. - shkschneider
Thanks @shkschneider. The only question I get is Delete project contents on disk (cannot be undone)?. Is that asking to delete the project information while preserving the source code? It looks as if it would just delete the project info from the workspace, but maybe keep .cproject and .project in disk. - Josh
Yeah. What I usually do is remove using eclipse (do NOT delete project contents on disk) and remove any .* eclipse-related file that could stay. It worked for what I wanted, but it's maybe not what you want, so I post this as a comment :) - shkschneider

1 Answers

0
votes

What I usually do is remove the project using eclipse (do not delete project contents on disk) and remove any .* eclipse-related file that could stay.

eclipse-delete-project

With the checkout unchecked, it deletes the project informations while preserving the source code.