项目功能 > Eclipse 中的清理

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/4549161/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-10 19:49:51  来源:igfitidea点击:

Function of Project > Clean in Eclipse

eclipse

提问by Eugene

What does Eclipse's Project → Clean...tool actually do?

Eclipse 的Project → Clean...工具实际上做了什么?

采纳答案by Konstantin Komissarchik

Its function depends on the builders that you have in your project (they can choose to interpret clean command however they like) and whether you have auto-build turned on. If auto-build is on, invoking clean is equivalent of a clean build. First artifacts are removed, then a full build is invoked. If auto-build is off, clean will remove the artifacts and stop. You can then invoke build manually later.

它的功能取决于您项目中的构建器(他们可以选择解释clean 命令,但是他们喜欢)以及您是否打开了自动构建。如果启用了自动构建,则调用 clean 等效于干净构建。首先删除工件,然后调用完整构建。如果自动构建关闭,clean 将删除工件并停止。然后您可以稍后手动调用构建。

回答by BoltClock

It removes whatever already-compiled files are in your project so that you can do a complete fresh rebuild.

它会删除您项目中任何已编译的文件,以便您可以进行全新的重建。

回答by ChopperCharles

There's another problem at work here. The Clean functionality of Eclipse is broken. If you delete files outside of Eclipse it will not pick up on the fact that the files are now missing, and you'll get build errors until you delete the files manually. Even then, that will not necessarily work either, especially if there are a lot of files missing. This happens to me rather often when I check out a branch of code that has had a lot of changes since the last time I built it. In that case, the only recourse I've found is to start a brand new workspace and reload the project from scratch.

这里还有一个工作问题。Eclipse 的 Clean 功能已损坏。如果您在 Eclipse 之外删除文件,它不会发现文件现在丢失的事实,并且您将收到构建错误,直到您手动删除文件。即便如此,这也不一定有效,尤其是在缺少大量文件的情况下。当我检查自上次构建以来发生了很多变化的代码分支时,这种情况经常发生在我身上。在这种情况下,我找到的唯一办法是启动一个全新的工作区并从头开始重新加载项目。

回答by Randhir

I also faced the same issue with Eclipse when I ran the clean build with Maven, but there is a simple solution for this issue. We just need to run Maven update and then build or direct run the application. I hope it will solve the problem.

当我使用 Maven 运行干净构建时,我也遇到了与 Eclipse 相同的问题,但有一个简单的解决方案可以解决这个问题。我们只需要运行 Maven 更新然后构建或直接运行应用程序。我希望它能解决问题。