简体   繁体   English

Eclipse:删除Eclipse生成的.class和.project文件

[英]Eclipse: Remove Eclipse generated .class and .project files

I have a Java project with SVN version control system. 我有一个带有SVN版本控制系统的Java项目。 My IDE is eclipse. 我的IDE偏食。 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. 其他人将自己的.class和.project文件提交到svn中。 When I pointed out, he removed .class and .project in some particular sub projects. 当我指出时,他在某些特定的子项目中删除了.class和.project。 Anyway, I have .class and .project in all sub projects. 无论如何,我在所有子项目中都有.class和.project。 Now I want to a clean environment, I want to delete all .class and .project files. 现在我想要一个干净的环境,我想删除所有.class和.project文件。 Are there some script available in this forum? 这个论坛中有可用的脚本吗?

您没有提到正在使用什么操作系统...如果是Linux,则可以在命令行中执行以下操作:

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

If you have a unix like environment then 'find' from a command line could do it. 如果您具有类似Unix的环境,则可以从命令行“查找”它。 First cd to the project directory then find . 首先cd到项目目录,然后找到。 ( -name *.class -or -name .project ) -delete (-name * .class -or -name .project)-删除

Are you using Maven as a build tool? 您是否正在使用Maven作为构建工具? What is your directory structure. 您的目录结构是什么?

Any bin, out, target etc. directories should be on ignore list in SVN. 任何bin,out,target等目录都应位于SVN中的忽略列表中。 You can use "add to ignore list" in Tortoise SVN or edit folder properties and set "svn:ignore" property. 您可以在Tortoise SVN中使用“添加到忽略列表”,也可以编辑文件夹属性并设置“ svn:ignore”属性。 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. 如果您不使用Maven,则删除.project和.classpath可能会造成一些麻烦。 There might be some project-specific settings set. 可能设置了一些特定于项目的设置。 Blindly deleting .project files is not a solution. 盲目删除.project文件不是解决方案。 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. 如果使用Maven,则可以定义删除.project,.classpath和.settings,将它们添加到忽略列表,然后使用m2e插件重新导入所有项目。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM