如何在不从Eclipse删除源的情况下删除与Eclipse项目相关的文件 [英] How to remove Eclipse project related files without deleteing the source from Eclipse

查看:178
本文介绍了如何在不从Eclipse删除源的情况下删除与Eclipse项目相关的文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

每当我们要使用现有源位置创建Eclipse项目时,我们都会选择现有源位置(根)作为项目位置。 Eclipse将在该源的根目录中创建所有特定于项目的文件。

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.

现在,由于某些原因,如果我们要使用不同的设置重新创建项目,如何我们应该告诉Eclipse不要删除源,而是删除所有与项目相关的文件吗?基本上是清除所有与Eclipse相关的文件。例如,我想在其他IDE中创建项目,是否必须转到项目目录并手动标识所有与Eclipse相关的文件并将其删除?

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?

当我们尝试从Eclipse删除项目时,我们有两个选择,从项目中删除所有内容(选中复选框时)或保留项目中的所有内容(这只会从项目资源管理器中删除项目,而保留所有项目

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).

每次,手动删除与项目相关的文件都很麻烦。不管怎样,直接从Eclipse中删除与Eclipse相关的项目文件会很好。

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.

有什么想法吗?

推荐答案

在UNIX / Linux上,您可以手动执行-打开终端并导航到项目的根目录,然后执行以下命令:

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 {} \;

如果有人喜欢别名:

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 {} \;'

注意:您最好先从Eclipse中删除项目,以免丢失的配置引起混淆。

NOTE: You'd better remove the project first from Eclipse so it won't get confused by the missing configuration.

这篇关于如何在不从Eclipse删除源的情况下删除与Eclipse项目相关的文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆